Add "#include <stdlib.h>" (to declatre exit(3)) to example program.

This commit is contained in:
Michael Kerrisk 2007-09-10 02:44:09 +00:00
parent c3c1773e57
commit af9c7ff296
8 changed files with 8 additions and 0 deletions

View File

@ -137,6 +137,7 @@ passed by-value or by-pointer (for aggregates like structs).
.sp .sp
.nf .nf
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <errno.h> #include <errno.h>
#include <linux/unistd.h> /* for _syscallX macros/related stuff */ #include <linux/unistd.h> /* for _syscallX macros/related stuff */
#include <linux/kernel.h> /* for struct sysinfo */ #include <linux/kernel.h> /* for struct sysinfo */

View File

@ -476,6 +476,7 @@ to a local variable and passing that variable to the system call.
.SH EXAMPLE .SH EXAMPLE
.nf .nf
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>

View File

@ -120,6 +120,7 @@ Handle with care.
.sp .sp
.nf .nf
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <envz.h> #include <envz.h>
int int

View File

@ -237,6 +237,7 @@ vpfmt(), lfmt(), and vlfmt()", and will be removed later.
.SH EXAMPLE .SH EXAMPLE
.nf .nf
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <fmtmsg.h> #include <fmtmsg.h>
int int

View File

@ -143,6 +143,7 @@ in the stream with all other threads.
#define _GNU_SOURCE #define _GNU_SOURCE
#include <grp.h> #include <grp.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#define BUFLEN 4096 #define BUFLEN 4096
int int

View File

@ -82,6 +82,7 @@ The result is the localtime of the computer 'linux'.
.sp .sp
.nf .nf
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
#include <time.h> #include <time.h>

View File

@ -384,6 +384,7 @@ and
.sp .sp
.nf .nf
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <time.h> #include <time.h>
int int

View File

@ -86,6 +86,7 @@ The output is approximately that of "ls [a-c]*.c".
.LP .LP
.nf .nf
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <wordexp.h> #include <wordexp.h>
int int