2008-09-30 11:25:55 +00:00
|
|
|
/* $FreeBSD$ */
|
1994-08-10 06:40:36 +00:00
|
|
|
#if __FreeBSD__ == 0 /* 1.0 did not define __FreeBSD__ */
|
|
|
|
#define __FreeBSD_version 199401
|
|
|
|
#elif __FreeBSD__ == 1 /* 1.1 defined it to be 1 */
|
|
|
|
#define __FreeBSD_version 199405
|
|
|
|
#else /* 2.0 and higher define it to be 2 */
|
|
|
|
#include <osreldate.h> /* and this works */
|
|
|
|
#endif
|
2008-09-30 11:25:55 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <unistd.h>
|
1994-08-10 06:40:36 +00:00
|
|
|
|
2008-09-30 11:25:55 +00:00
|
|
|
int
|
|
|
|
main(void) {
|
|
|
|
printf("Compilation release date: %d\n", __FreeBSD_version);
|
1994-08-10 06:40:36 +00:00
|
|
|
#if __FreeBSD_version >= 199408
|
2008-09-30 11:25:55 +00:00
|
|
|
printf("Execution environment release date: %d\n", getosreldate());
|
1994-08-10 06:40:36 +00:00
|
|
|
#else
|
2008-09-30 11:25:55 +00:00
|
|
|
printf("Execution environment release date: can't tell\n");
|
1994-08-10 06:40:36 +00:00
|
|
|
#endif
|
2008-09-30 11:25:55 +00:00
|
|
|
return (0);
|
1994-08-10 06:40:36 +00:00
|
|
|
}
|