mirror of https://gitee.com/Nocallback/glibc.git
9 changed files with 62 additions and 674 deletions
@ -1,98 +0,0 @@ |
|||||
/* Copyright (C) 1991, 1993, 1997 Free Software Foundation, Inc.
|
|
||||
This file is part of the GNU C Library. |
|
||||
|
|
||||
The GNU C Library is free software; you can redistribute it and/or |
|
||||
modify it under the terms of the GNU Lesser General Public |
|
||||
License as published by the Free Software Foundation; either |
|
||||
version 2.1 of the License, or (at your option) any later version. |
|
||||
|
|
||||
The GNU C Library is distributed in the hope that it will be useful, |
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
||||
Lesser General Public License for more details. |
|
||||
|
|
||||
You should have received a copy of the GNU Lesser General Public |
|
||||
License along with the GNU C Library; if not, see |
|
||||
<http://www.gnu.org/licenses/>. */
|
|
||||
|
|
||||
#include <errno.h> |
|
||||
|
|
||||
static char iferrno[] = "#ifdef _ERRNO_H"; |
|
||||
static char endiferrno[] = "#endif /* <errno.h> included. */"; |
|
||||
static char ifEmath[] = "#if !defined(__Emath_defined) && \
|
|
||||
(defined(_ERRNO_H) || defined(__need_Emath))"; |
|
||||
static char endifEmath[] = "#endif /* Emath not defined and <errno.h> \
|
|
||||
included or need Emath. */"; |
|
||||
|
|
||||
static int biggest_value = 0; |
|
||||
static int done_ENOSYS = 0; |
|
||||
static int done_ERANGE = 0, done_EDOM = 0; |
|
||||
|
|
||||
static void |
|
||||
DO(name, value) |
|
||||
char *name; |
|
||||
int value; |
|
||||
{ |
|
||||
int is_ERANGE = !done_ERANGE && !strcmp(name, "ERANGE"); |
|
||||
int is_EDOM = !done_EDOM && !strcmp(name, "EDOM"); |
|
||||
int is_Emath = is_ERANGE || is_EDOM; |
|
||||
|
|
||||
if (is_Emath) |
|
||||
{ |
|
||||
puts(endiferrno); |
|
||||
puts(ifEmath); |
|
||||
} |
|
||||
|
|
||||
if (!strcmp (name, "EWOULDBLOCK")) |
|
||||
{ |
|
||||
puts ("#define EWOULDBLOCK EAGAIN /* Translated in glibc. */"); |
|
||||
name = "EWOULDBLOCK_sys /* Value actually returned by kernel. */"; |
|
||||
} |
|
||||
|
|
||||
printf ("#define %s %d\n", name, value); |
|
||||
|
|
||||
if (is_Emath) |
|
||||
{ |
|
||||
puts(endifEmath); |
|
||||
puts(iferrno); |
|
||||
} |
|
||||
|
|
||||
if (value > biggest_value) |
|
||||
biggest_value = value; |
|
||||
|
|
||||
if (is_ERANGE) |
|
||||
done_ERANGE = 1; |
|
||||
else if (is_EDOM) |
|
||||
done_EDOM = 1; |
|
||||
else if (!done_ENOSYS && !strcmp(name, "ENOSYS")) |
|
||||
done_ENOSYS = 1; |
|
||||
} |
|
||||
|
|
||||
int |
|
||||
main() |
|
||||
{ |
|
||||
puts(iferrno); |
|
||||
|
|
||||
ERRNOS; |
|
||||
|
|
||||
if (!done_EDOM || !done_ERANGE) |
|
||||
{ |
|
||||
puts(endiferrno); |
|
||||
puts(ifEmath); |
|
||||
if (!done_EDOM) |
|
||||
printf("#define EDOM %d\n", ++biggest_value); |
|
||||
if (!done_ERANGE) |
|
||||
printf("#define ERANGE %d\n", ++biggest_value); |
|
||||
puts(endifEmath); |
|
||||
} |
|
||||
|
|
||||
if (!done_ENOSYS) |
|
||||
printf("#define ENOSYS %d\n", ++biggest_value); |
|
||||
|
|
||||
puts(endiferrno); |
|
||||
|
|
||||
puts("#undef __need_Emath"); |
|
||||
puts("#ifndef __Emath_defined\n#define __Emath_defined 1\n#endif"); |
|
||||
|
|
||||
exit(0); |
|
||||
} |
|
||||
@ -1,12 +0,0 @@ |
|||||
BEGIN { special = 0 } |
|
||||
|
|
||||
/ERRNOS/ { nerrnos = split(errnos, errs) |
|
||||
for (i = 1; i <= nerrnos; ++i) |
|
||||
# Some systems define errno codes inside undefined #ifdefs, |
|
||||
# and then never actually use them. |
|
||||
printf "#ifdef %s\n DO(\"%s\", %s);\n#endif\n", \ |
|
||||
errs[i], errs[i], errs[i] |
|
||||
special = 1 } |
|
||||
|
|
||||
|
|
||||
{ if (special == 0) print $0; special = 0 } |
|
||||
@ -1,134 +0,0 @@ |
|||||
/* On SVR4, this #define is necessary to make <sys/ioctl.h> define
|
|
||||
many of the ioctls. */ |
|
||||
#define BSD_COMP |
|
||||
|
|
||||
#include <sys/types.h> |
|
||||
#include <sys/param.h> |
|
||||
|
|
||||
/* On SunOS 4.1, <sys/ioctl.h> and <sys/termios.h> define some symbols
|
|
||||
with different values, but <sys/termios.h> defines some ioctl symbols |
|
||||
not in <sys/ioctl.h>, so we need it. Our <sys/ioctl.h> should define |
|
||||
them with the values from Sun's <sys/ioctl.h>, not <sys/termios.h>. |
|
||||
So we include <sys/termios.h> and let <sys/ioctl.h> redefine things. |
|
||||
This produces some spurious warnings. */ |
|
||||
|
|
||||
#ifdef HAVE_sys_termios_h |
|
||||
#include <sys/termios.h> |
|
||||
#endif |
|
||||
|
|
||||
/* This causes <sys/ioctl.h> to define some necessary data structure. */ |
|
||||
#ifdef sony_news |
|
||||
#define KANJI |
|
||||
#endif |
|
||||
|
|
||||
#include <sys/ioctl.h> |
|
||||
|
|
||||
#ifdef SIOCGIFCONF |
|
||||
#include <sys/socket.h> |
|
||||
#include <sys/time.h> |
|
||||
#include <net/if.h> |
|
||||
#include <net/route.h> |
|
||||
#if defined(SIOCGARP) && !defined(ARPOP_REQUEST) |
|
||||
#include <net/if_arp.h> |
|
||||
#endif |
|
||||
#ifdef SIOCGNIT |
|
||||
#ifdef HAVE_net_nit_h |
|
||||
#include <net/nit.h> |
|
||||
#else /* No net/nit.h. */ |
|
||||
#undef SIOCGNIT |
|
||||
#undef SIOCSNIT |
|
||||
#endif /* net/nit.h. */ |
|
||||
#endif /* SIOCGNIT. */ |
|
||||
#endif /* SIOCGIFCONF. */ |
|
||||
|
|
||||
/* These exist on Sequents. */ |
|
||||
#ifdef SMIOSTATS |
|
||||
#include <sec/sec.h> |
|
||||
#include <sec/sm.h> |
|
||||
#endif |
|
||||
#ifdef SMIOGETREBOOT0 |
|
||||
#include <i386/cfg.h> |
|
||||
#endif |
|
||||
#ifdef ZIOCBCMD |
|
||||
#include <zdc/zdc.h> |
|
||||
#endif |
|
||||
|
|
||||
/* These exist under Ultrix, but I figured there may be others. */ |
|
||||
#ifdef DIOCGETPT |
|
||||
#include <ufs/fs.h> /* for DIOC* */ |
|
||||
#endif |
|
||||
#ifdef DEVGETGEOM |
|
||||
#include <sys/devio.h> |
|
||||
#endif |
|
||||
|
|
||||
#ifdef ultrix |
|
||||
/* Ultrix has a conditional include that brings these in; we have to force
|
|
||||
their inclusion when we actually compile them. */ |
|
||||
#undef TCGETA |
|
||||
#undef TCSETA |
|
||||
#undef TCSETAW |
|
||||
#undef TCSETAF |
|
||||
#undef TCGETP |
|
||||
#undef TCSANOW |
|
||||
#undef TCSADRAIN |
|
||||
#undef TCSAFLUSH |
|
||||
#ifdef ELSETPID |
|
||||
#include <sys/un.h> /* get sockaddr_un for elcsd.h */ |
|
||||
#include <elcsd.h> |
|
||||
#endif |
|
||||
#ifdef DKIOCDOP |
|
||||
#include <sys/dkio.h> |
|
||||
#endif |
|
||||
/* Couldn't find the header where the structures used by these are
|
|
||||
defined; it looks like an unbundled LAT package or something. */ |
|
||||
#undef LIOCSOL |
|
||||
#undef LIOCRES |
|
||||
#undef LIOCCMD |
|
||||
#undef LIOCINI |
|
||||
#undef LIOCTTYI |
|
||||
#undef LIOCCONN |
|
||||
/* struct mtop hasn't been in sys/mtio.h since 4.1 */ |
|
||||
#undef MTIOCTOP |
|
||||
#undef MTIOCGET |
|
||||
#endif |
|
||||
|
|
||||
#if defined(__osf__) && defined(__alpha__) |
|
||||
#include <sys/ioctl_compat.h> /* To get TIOCGETP, etc. */ |
|
||||
#include <alpha/pt.h> /* for DIOC* */ |
|
||||
#include <sys/mtio.h> /* for MTIOC* */ |
|
||||
/* The binlog_getstatus structure doesn't seem to be defined. */ |
|
||||
#undef BINLOG_GETSTATUS |
|
||||
/* Can't find `struct ifdata' anywhere. */ |
|
||||
#undef SIOCMANREQ |
|
||||
#undef SIOCGETEVENTS |
|
||||
/* OSF/1 smells an awful lot like Ultrix. */ |
|
||||
#undef TCGETA |
|
||||
#undef TCSETA |
|
||||
#undef TCSETAF |
|
||||
#undef TCSETAW |
|
||||
/* This macro looks screwed in sys/devio.h. */ |
|
||||
#undef DEV_DISKPART |
|
||||
/* This is in sys/dkio.h, but we don't need it. */ |
|
||||
#undef DKIOCACC |
|
||||
#undef DKIOCDOP |
|
||||
#undef DKIOCEXCL |
|
||||
#undef DKIOCGET |
|
||||
#undef DKIOCHDR |
|
||||
/* Introduced by OSF/1 2.0. */ |
|
||||
#undef FIOPIPESTAT |
|
||||
#undef SIOCSRREQR |
|
||||
#undef SIOCSRREQW |
|
||||
#undef SRVC_REQUEST |
|
||||
#endif |
|
||||
|
|
||||
#define DEFINE(name, value) \ |
|
||||
printf("#define %s 0x%.8x\n", (name), (value)) |
|
||||
|
|
||||
int |
|
||||
main() |
|
||||
{ |
|
||||
REQUESTS |
|
||||
|
|
||||
exit(0); |
|
||||
return 0; |
|
||||
} |
|
||||
@ -1,10 +0,0 @@ |
|||||
BEGIN { special = 0 } |
|
||||
|
|
||||
/REQUESTS/ { nreqs = split(requests, reqs) |
|
||||
for (i = 1; i <= nreqs; ++i) |
|
||||
printf "#ifdef\t%s\n DEFINE(\"%s\", %s);\n#endif\n", \ |
|
||||
reqs[i], reqs[i], reqs[i] |
|
||||
special = 1 } |
|
||||
|
|
||||
|
|
||||
{ if (special == 0) print $0; special = 0 } |
|
||||
@ -1,125 +0,0 @@ |
|||||
/* Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
|
|
||||
This file is part of the GNU C Library. |
|
||||
|
|
||||
The GNU C Library is free software; you can redistribute it and/or |
|
||||
modify it under the terms of the GNU Lesser General Public |
|
||||
License as published by the Free Software Foundation; either |
|
||||
version 2.1 of the License, or (at your option) any later version. |
|
||||
|
|
||||
The GNU C Library is distributed in the hope that it will be useful, |
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
||||
Lesser General Public License for more details. |
|
||||
|
|
||||
You should have received a copy of the GNU Lesser General Public |
|
||||
License along with the GNU C Library; if not, see |
|
||||
<http://www.gnu.org/licenses/>. */
|
|
||||
|
|
||||
#include <stdio.h> |
|
||||
#include <sys/types.h> |
|
||||
|
|
||||
#ifdef HAVE_SYS_PARAM_H |
|
||||
#include <sys/param.h> |
|
||||
#endif |
|
||||
|
|
||||
#ifdef HAVE_LIMITS_H |
|
||||
#include <limits.h> |
|
||||
#endif |
|
||||
|
|
||||
#ifdef HAVE_SYS_LIMITS_H |
|
||||
#include <sys/limits.h> |
|
||||
#endif |
|
||||
|
|
||||
/* Generate bits/local_lim.h from the values defined in the system's
|
|
||||
headers. */ |
|
||||
|
|
||||
struct param |
|
||||
{ |
|
||||
char *name; |
|
||||
int value; |
|
||||
}; |
|
||||
|
|
||||
static struct param params[] = |
|
||||
{ |
|
||||
|
|
||||
#if !defined (ARG_MAX) && defined (NCARGS) |
|
||||
#define ARG_MAX NCARGS |
|
||||
#endif |
|
||||
#ifdef ARG_MAX |
|
||||
{ "ARG_MAX", ARG_MAX }, |
|
||||
#endif |
|
||||
|
|
||||
#if !defined (CHILD_MAX) && defined (MAXUPRC) |
|
||||
#define CHILD_MAX MAXUPRC |
|
||||
#endif |
|
||||
#ifdef CHILD_MAX |
|
||||
{ "CHILD_MAX", CHILD_MAX }, |
|
||||
#endif |
|
||||
|
|
||||
#if !defined (LINK_MAX) && defined (MAXLINK) |
|
||||
#define LINK_MAX MAXLINK |
|
||||
#endif |
|
||||
#ifdef LINK_MAX |
|
||||
{ "LINK_MAX", LINK_MAX }, |
|
||||
#endif |
|
||||
|
|
||||
#if !defined (OPEN_MAX) && defined (NOFILE) |
|
||||
#define OPEN_MAX NOFILE |
|
||||
#endif |
|
||||
#ifdef OPEN_MAX |
|
||||
{ "OPEN_MAX", OPEN_MAX }, |
|
||||
#endif |
|
||||
|
|
||||
#if !defined (MAX_CANON) && defined (CANBSIZ) |
|
||||
#define MAX_CANON CANBSIZ |
|
||||
#endif |
|
||||
#ifdef MAX_CANON |
|
||||
{ "MAX_CANON", MAX_CANON }, |
|
||||
#endif |
|
||||
|
|
||||
#if !defined (NAME_MAX) && defined (MAXNAMLEN) |
|
||||
#define NAME_MAX MAXNAMLEN |
|
||||
#endif |
|
||||
#ifndef NAME_MAX |
|
||||
#define NAME_MAX 255 /* XXX ? */ |
|
||||
#endif |
|
||||
{ "NAME_MAX", NAME_MAX }, |
|
||||
|
|
||||
#if !defined (PATH_MAX) && defined (MAXPATHLEN) |
|
||||
#define PATH_MAX MAXPATHLEN |
|
||||
#endif |
|
||||
#ifdef PATH_MAX |
|
||||
{ "PATH_MAX", PATH_MAX }, |
|
||||
#endif |
|
||||
|
|
||||
#if !defined (SYMLOOP_MAX) && defined (MAXSYMLINKS) |
|
||||
#define SYMLOOP_MAX MAXSYMLINKS |
|
||||
#endif |
|
||||
#ifdef SYMLOOP_MAX |
|
||||
{ "SYMLOOP_MAX", SYMLOOP_MAX }, |
|
||||
#endif |
|
||||
|
|
||||
{ NULL, 0 } |
|
||||
}; |
|
||||
|
|
||||
int |
|
||||
main() |
|
||||
{ |
|
||||
extern char *ctime (); |
|
||||
extern time_t time (); |
|
||||
time_t now = time ((time_t *) NULL); |
|
||||
register struct param *p; |
|
||||
|
|
||||
if (! params[0].name) |
|
||||
/* We have no information to give, so let the caller know. */ |
|
||||
exit (1); |
|
||||
|
|
||||
printf ("\
|
|
||||
/* Implementation-specific limits.\n\
|
|
||||
Generated at %.24s. */\n\n", ctime (&now)); |
|
||||
|
|
||||
for (p = params; p->name != NULL; ++p) |
|
||||
printf ("#define %s %d\n", p->name, p->value); |
|
||||
|
|
||||
exit (0); |
|
||||
} |
|
||||
@ -1,48 +0,0 @@ |
|||||
#!/bin/sh |
|
||||
# Copyright (C) 1991, 1992, 1995, 1997 Free Software Foundation, Inc. |
|
||||
# This file is part of the GNU C Library. |
|
||||
|
|
||||
# The GNU C Library is free software; you can redistribute it and/or |
|
||||
# modify it under the terms of the GNU Lesser General Public |
|
||||
# License as published by the Free Software Foundation; either |
|
||||
# version 2.1 of the License, or (at your option) any later version. |
|
||||
|
|
||||
# The GNU C Library is distributed in the hope that it will be useful, |
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
||||
# Lesser General Public License for more details. |
|
||||
|
|
||||
# You should have received a copy of the GNU Lesser General Public |
|
||||
# License along with the GNU C Library; if not, see |
|
||||
# <http://www.gnu.org/licenses/>. |
|
||||
|
|
||||
sysincludedir=${sysincludedir-/usr/include} |
|
||||
|
|
||||
if [ ! "$snarfexclude" ]; then |
|
||||
# Filter out some headers which cause trouble. |
|
||||
# Reportedly a bug in sunos4.1.2's sed makes this lose if |
|
||||
# the two cmds are in a single sed invocation. |
|
||||
snarfexclude="`echo !${sysincludedir}/sys/param.h! \ |
|
||||
!${sysincludedir}/sys/time.h! \ |
|
||||
!${sysincludedir}/sys/types.h! \ |
|
||||
| sed 's,/,\\\\/,g' \ |
|
||||
| sed 's,!\\([^!]*\\)!,-e /\\1/d,g'`" |
|
||||
fi |
|
||||
|
|
||||
for file in $*; do |
|
||||
sed -n 's/^#define[ ]*\([A-Z][A-Z0-9_]*\)[ ][ ]*[^ ].*$/\1/p' \ |
|
||||
< $file |
|
||||
|
|
||||
snarfexclude="$snarfexclude \ |
|
||||
`echo $file | sed -e 's,/,\\\\/,g' -e 's,^.*$,-e /&/d,'`" |
|
||||
export snarfexclude |
|
||||
|
|
||||
included="`sed -n < $file \ |
|
||||
-e 's,^#include[ ]*<\(.*\)>.*$,'${sysincludedir}'/\1,p'\ |
|
||||
| sed $snarfexclude`" |
|
||||
if [ "$included" ]; then |
|
||||
$0 $included |
|
||||
fi |
|
||||
done |
|
||||
|
|
||||
exit 0 |
|
||||
Loading…
Reference in new issue