# New, cleaner detection code. -8/15/99 Sean-Paul Rees (sean@dreamfire.net)
cat > $TMP << __EOF__
#include <stdio.h>
-main()
+int main(void)
{
#ifdef __GLIBC__
printf("%d_%d\n", __GLIBC__, __GLIBC_MINOR__);
printf("0\n");
#endif
- exit(0);
+ return 0;
}
__EOF__
#
echo " "
# Check it out
cat > $TMP <<__EOF__
-main() {}
+int main(void) {}
__EOF__
$CCPATH $TMP -o $EXEC >/dev/null 2>&1
if [ ! -f $EXEC ] ; then
#
echo $n "Searching for bcopy/bzero/bcmp...$c"
cat > $TMP <<__EOF__
-main()
+int main(void)
{
char a[3], b[3];
bzero(b,3);
bcopy(a,b,3);
(void)bcmp(a,b,3);
- exit(0);
+ return 0;
}
__EOF__
$COMP >/dev/null 2>&1
cat > $TMP <<__EOF__
#include <stdio.h>
#include <sys/time.h>
-main()
+int main(void)
{
struct timeval tv;
(void) gettimeofday(&tv, NULL);
else
echo "No gettimeofday. Trying lrand48."
cat > $TMP <<__EOF__
-main()
+int main(void)
{
int a;
a=lrand48();
#include <sys/ioctl.h>
#include <sys/file.h>
#include <signal.h>
+#include <stdlib.h>
alarmed()
{
exit(1);
}
-main()
+int main(void)
{
char b[12], x[32];
int f, l = sizeof(x);
alarm(0);
exit(0);
}
- exit(1);
+ return 1;
}
__EOF__
sed -e 's/BLOCKING/O_NONBLOCK/' $PLATE > $TMP
cat > $TMP <<__EOF__
#include <signal.h>
-main()
+int main(void)
{ /* poor replacement for NULL but who cares here ? */
sigaction(SIGTERM, (struct sigaction *)0L, (struct sigaction *)0L);
}
kill(getpid(), SIGTERM);
sleep(1);
}
-main()
+int main(void)
{
signal(SIGTERM, handler);
kill(getpid(), SIGTERM);
- exit (0);
+ retrun 0;
}
__EOF__
echo $n "No, but you have...$c"
#ifdef STRINGSH
#include <strings.h>
#endif
-main()
+int main(void)
{
char *s = index("foo", 'o');
- exit(0);
+ return 0;
}
__EOF__
$COMP >/dev/null 2>&1
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
-main()
+int main(void)
{
struct rusage rus;
(void)getrusage(RUSAGE_SELF, &rus);
#include <sys/types.h>
#include <sys/time.h>
#include <sys/times.h>
-main()
+int main(void)
{
struct tms tmsbuf;
(void)times(&tmsbuf);
#ifdef STRINGSH
#include <strings.h>
#endif
-main()
+int main(void)
{
char *s = strcasecmp('a', 'a');
- exit(0);
+ return 0;
}
__EOF__
$COMP >/dev/null 2>&1
echo "Checking for additional components..."
echo $n "Searching...$c"
cat > $TMP <<__EOF__
-main()
+int main(void)
{
unsigned long foo;
char *s = strtoul("0x12345", &foo, 16);
- exit(0);
+ return 0;
}
__EOF__
$COMP >/dev/null 2>&1
fi
$RM -f $EXEC $TMP
cat > $TMP <<__EOF__
-main()
+int main(void)
{
char *s = strerror(0);
- exit(0);
+ return 0;
}
__EOF__
$COMP >/dev/null 2>&1
#include <arpa/nameser.h>
#include <resolv.h>
-main()
+int main(void)
{
dn_skipname("","");
- exit(0);
+ return 0;
}
__EOF__
$COMP >/dev/null 2>&1
$RM -f $EXEC $TMP
cat > $TMP <<__EOF__
#include <sys/types.h>
-main()
+int main(void)
{
u_int32_t foo;
- exit(0);
+ return 0;
}
__EOF__
$COMP >/dev/null 2>&1
#ifdef STRINGSH
#include <strings.h>
#endif
-main()
+int main(void)
{
char t[] = "a", **p = NULL, *s = strtoken(&p, t, ",");
if (!strcmp(t, s))
exit(0);
- exit(1);
+ return 1;
}
__EOF__
$COMP >/dev/null 2>&1
#ifdef STRINGSH
#include <strings.h>
#endif
-main()
+int main(void)
{
char t[] = "a", *s = strtok(t, ",");
if (!strcmp(t, s))
exit(0);
- exit(1);
+ return 1;
}
__EOF__
$COMP >/dev/null 2>&1
cat > $TMP << __EOF__
#include <sys/types.h>
#include <netinet/in.h>
-main()
+int main(void)
{
struct in_addr in;
(void)inet_addr("1.2.3.4");
cat > $TMP << __EOF__
#include <sys/types.h>
#include <netinet/in.h>
-main()
+int main(void)
{
struct in_addr in;
in.s_addr = 0x12345678;
cat > $TMP << __EOF__
#include <sys/types.h>
#include <netinet/in.h>
-main()
+int main(void)
{
struct in_addr in;
in.s_addr = 0x87654321;