Properly set stuff up (defined _POSIX_C_SOURCE)

This commit is contained in:
Gitea 2020-12-12 00:33:20 -06:00
parent e6c12928b8
commit 7cb8f7174d
20 changed files with 42 additions and 24 deletions

2
asa.c
View file

@ -1,3 +1,5 @@
#define _POSIX_C_SOURCE 200809L
#include <stdio.h>
#include <stdlib.h>

View file

@ -1,3 +1,5 @@
#define _POSIX_C_SOURCE 200809L
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

2
cat.c
View file

@ -1,3 +1,5 @@
#define _POSIX_C_SOURCE 200809L
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

View file

@ -1,3 +1,5 @@
#define _POSIX_C_SOURCE 200809L
#include <stdio.h>
#include <stdlib.h>
@ -83,7 +85,7 @@ int main(int argc, char ** argv) {
fprintf(stderr, "Cannot find file %s\n", argv[i]);
}
else
printf("%u %d %s\n", crc32(current_file), count_octets(current_file),
printf("%u %d %s\n", crc32(in_file), count_octets(in_file),
argv[i]);
}

2
cmp.c
View file

@ -1,3 +1,5 @@
#define _POSIX_C_SOURCE 200809L
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

View file

@ -1,3 +1,5 @@
#define _POSIX_C_SOURCE 200809L
#include <stdio.h>
#include <string.h>

2
echo.c
View file

@ -1,3 +1,5 @@
#define _POSIX_C_SOURCE 200809L
#include <stdio.h>
int ctoi(char c);

View file

@ -1,3 +1,5 @@
#define _POSIX_C_SOURCE 200809L
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

View file

@ -1,3 +1,5 @@
#define _POSIX_C_SOURCE 200809L
int main() {
return -1;
}

2
head.c
View file

@ -1,3 +1,5 @@
#define _POSIX_C_SOURCE 200809L
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

2
link.c
View file

@ -1,3 +1,5 @@
#define _XOPEN_SOUCE 700
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>

2
ln.c
View file

@ -1,3 +1,5 @@
#define _POSIX_C_SOURCE 200809L
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>

View file

@ -1,3 +1,5 @@
#define _POSIX_C_SOURCE 200809L
#include <stdio.h>
#include <unistd.h>
#include <errno.h>

2
pwd.c
View file

@ -1,3 +1,5 @@
#define _POSIX_C_SOURCE 200809L
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>

View file

@ -1,3 +1,5 @@
#define _POSIX_C_SOURCE 200809L
#include <unistd.h>
#include <stdlib.h>

12
tee.c
View file

@ -1,17 +1,9 @@
#define _POSIX_C_SOURCE 200809L
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
/*
Why is it always the fucking GNU Project causing
problems?! For fuck's sake!
-Kat
*/
#ifdef __GLIBC__
#define __USE_POSIX2
#endif
#include <unistd.h>
int main(int argc, char * argv[]) {

2
true.c
View file

@ -1,3 +1,5 @@
#define _POSIX_C_SOURCE 200809L
int main() {
return 0;
}

4
tty.c
View file

@ -1,6 +1,8 @@
#define _POSIX_C_SOURCE 200809L
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <stdio.h>
int main() {
if(isatty(fileno(stdin))) {

14
uname.c
View file

@ -1,18 +1,8 @@
#define _POSIX_C_SOURCE 200809L
#include <stdio.h>
#include <sys/utsname.h>
#include <stdlib.h>
/*
Ah, yes. Stuff just to satisfy the GNU project.
I look forward to the day we can start doing
development on our own system with our own
C library. I should really work on that.
-Kat
*/
#ifdef __GLIBC__
#define __USE_POSIX2
#endif
#include <unistd.h>
int main(int argc, char * argv[]) {

2
wc.c
View file

@ -1,3 +1,5 @@
#define _POSIX_C_SOURCE 200809L
#include <stdio.h>
#include <stdlib.h>