From e45b2259ec3d7d128e1da66cf5b1a76f6618d9e9 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Tue, 30 Sep 2008 11:25:55 +0000 Subject: [PATCH] Add unistd.h to the getosreldate(3) manpage. Update referenced example to include unistd.h per manpage. Update example to be more style(9)-ish, silence warnings and add FreeBSD id to the source file. --- lib/libc/gen/getosreldate.3 | 3 ++- share/examples/FreeBSD_version/FreeBSD_version.c | 14 +++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/libc/gen/getosreldate.3 b/lib/libc/gen/getosreldate.3 index ade53b86195d..95f63b56c7db 100644 --- a/lib/libc/gen/getosreldate.3 +++ b/lib/libc/gen/getosreldate.3 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 2, 2005 +.Dd September 30, 2008 .Dt GETOSRELDATE 3 .Os .Sh NAME @@ -34,6 +34,7 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS +.In unistd.h .Ft int .Fn getosreldate void .Sh DESCRIPTION diff --git a/share/examples/FreeBSD_version/FreeBSD_version.c b/share/examples/FreeBSD_version/FreeBSD_version.c index 1d75897b9683..036a5aeaaa20 100644 --- a/share/examples/FreeBSD_version/FreeBSD_version.c +++ b/share/examples/FreeBSD_version/FreeBSD_version.c @@ -1,3 +1,4 @@ +/* $FreeBSD$ */ #if __FreeBSD__ == 0 /* 1.0 did not define __FreeBSD__ */ #define __FreeBSD_version 199401 #elif __FreeBSD__ == 1 /* 1.1 defined it to be 1 */ @@ -5,13 +6,16 @@ #else /* 2.0 and higher define it to be 2 */ #include /* and this works */ #endif +#include +#include -int main(void) { - extern int getosreldate(void); - printf("Compilation release date: %d\n", __FreeBSD_version); +int +main(void) { + printf("Compilation release date: %d\n", __FreeBSD_version); #if __FreeBSD_version >= 199408 - printf("Execution environment release date: %d\n", getosreldate()); + printf("Execution environment release date: %d\n", getosreldate()); #else - printf("Execution environment release date: can't tell\n"); + printf("Execution environment release date: can't tell\n"); #endif + return (0); }