Commit Graph

854 Commits

Author SHA1 Message Date
obrien
f82ce26f64 Add stpcpy(3). 2002-10-03 19:51:04 +00:00
mike
440b25e6ba Cope with a GCC bug by using an alternative, but equivalent function
prototype for regexec().

Noticed by: robert
2002-10-03 18:12:03 +00:00
mike
607bcfa63a Fix various style(9) bugs:
o Source ID's in wrong location.
o Space used, instead of tab, after typedef.
o Unaligned function prototype for twalk().

Other changes:
o Add missing const qualifier in tfind().
o Add comment about missing functions.
2002-10-03 06:31:16 +00:00
robert
4ab3b5c0e7 Add the 'restrict' type qualifier to the prototypes of `sigaction',
`sigprocmask', `sigaltstack', and `sigwait' as well as to the
prototypes of the apparantly unimplemented functions `sigtimedwait'
and `sigwaitinfo'.  This complies with IEEE Std 1003.1-2001.
2002-10-02 10:53:44 +00:00
mike
1c84681cf9 o Add typedef for size_t.
o Fix regoff_t typedef to not require <sys/types.h> as a prerequisite
  (specifically use `__off_t' instead of `off_t').
o Add restrict type-qualifier to function prototypes.
2002-10-02 07:48:13 +00:00
alfred
cb34f5fd2a Add prototypes for rstat(3) and havedisk(3).
Requested by: kris, Emil Mikulic <emikulic@optushome.com.au>
MFC After: 1 day
2002-10-01 17:59:53 +00:00
ru
ec9540417c test -h is deprecated; use -L instead.
PR:             bin/40846
2002-10-01 13:29:45 +00:00
bde
bfd55981c7 Merged all interesting difference between the old math.h and the current
one into the latter and removed the former.

This works around the bug that some broken Makefiles add -I.../src/include
to CFLAGS, resulting in the old math.h being preferred and differences
between the headers possibly being fatal.

The merge mainly involves declaring some functions as __pure2 although
they are not yet all strictly free of side effects.

PR:		43544
2002-10-01 11:34:42 +00:00
mike
3264749d81 Don't install mqueue.h, since it only makes things harder for porting
software when you provide prototypes for non-existent functions.
2002-09-30 17:14:26 +00:00
eric
21a7c522c7 Add getopt_long(3).
Obtained from:	NetBSD
Sponsored by:	Apple
2002-09-29 04:14:37 +00:00
tjr
79f7c6df9a Remove masking macros for getwc(), putwc(), putwchar() and getwchar().
Although there was nothing wrong with getwc() and putwc(), getwchar()
and putwchar() assumed that <stdio.h> had been included before <wchar.h>,
which is not allowed by the standard.
2002-09-28 07:43:44 +00:00
wollman
e2ee095e08 Back down to 1003.2-1992 for the time being -- it is causing too many
headaches for common but deprecated uses of standard utilities.
2002-09-25 01:58:56 +00:00
mike
d73b1f9b7b Add forgotten <sys/_types.h> include. Fix some style bugs while I'm
here.

PR: 43326
2002-09-24 17:28:12 +00:00
mike
e3273ff5b0 o Move select() helper macros from <sys/types.h> to <sys/select.h>.
o Include <sys/select.h> from <sys/types.h> in the __BSD_VISIBLE case,
  so applications and base software can be slowly updated.
o Prototype select() in <sys/select.h>.  It was previously only
  prototyped in <unistd.h>.
o Add some XXX's to <sys/types.h>.

Reviewed by: -standards
2002-09-23 17:45:51 +00:00
tjr
516923dd04 Add implementations of wscanf() and related functions: fwscanf(), swscanf(),
vfwscanf(), vswscanf(), vwscanf(). As the name suggests, these are wide-
character versions of the scanf() family of functions.
2002-09-23 12:40:06 +00:00
tjr
491569a0a7 Add the remaining C99 wide character string to integer conversion functions.
Restrict qualifiers were added to the existing prototypes in <inttypes.h>
and the typedef for wchar_t was removed.
2002-09-22 08:06:45 +00:00
bde
5ea401e1a6 Whitespace cleanup (half for fixing missing whitespace before `__restrict'
again).

Removed the second pair of banal comments about `quot' and `rem'.
2002-09-21 22:05:37 +00:00
bde
3194209385 Whitespace fixes (mainly for a space instead of a tab after #define). 2002-09-21 21:28:25 +00:00
tjr
111c3b394a Add implementations of the wprintf() family of functions, which perform
formatted wide-character output.
2002-09-21 13:00:30 +00:00
tjr
ecc81a520e Restrict visibility of wcslcat() and wcslcpy() to the __BSD_VISIBLE case. 2002-09-21 08:55:16 +00:00
wollman
79968085d7 Define constants for those POSIX options and option groups which are
(or would be) implemented (or not) exclusively in user-land.  A threads
expert should check over the values I have set to make sure that they
correctly reflect reality.

Move all sysconf() keys here from <sys/unistd.h> as they are not implemented
in the kernel.  Add new keys from 1003.1-2001 final text.  (Some additional
keys are expected in TC1.)

Add some protection against redundant declarations between <stdlib.h>
and <unistd.h> for some functions which XSI requires in the former and
BSD traditionally declares in the latter.  Restrict qualifiers and other
changes from 1003.1-2001 have not been made to the functions prototyped here.

(3 of 5)
2002-09-21 02:08:32 +00:00
wollman
f7d0cc804c Use new visibility macros. Reorder some disordered declarations. Add
new 1003.1-2001 declarations, commented out in cases where we do not
implement the function.  Note that strtoq() and strtouq() are slated
for deletion in 6.0.  (2 of 5)
2002-09-21 02:03:58 +00:00
wollman
07d36e2810 Use new visibility macros. (1 of 5) 2002-09-21 02:00:44 +00:00
wollman
aa09d8b564 Make the threatened fts(3) ABI fix. FTSENT now avoids the use of the struct
hack, thereby allowing future extensions to the structure (e.g., for extended
attributes) without rebreaking the ABI.  FTSENT now contains a pointer to the
parent stream, which fts_compar() can then take advantage of, avoiding the
undefined behavior previously warned about.  As a consequence of this change,
the prototype of the comparison function passed to fts_open() has changed
to reflect the required amount of constness for its use.  All callers in the
tree are updated to use the correct prototype.

Comparison functions can now make use of the new parent pointer to access
the new stream-specific private data pointer, which is intended to assist
creation of reentrant library routines which use fts(3) internally.

Not objected to in spirit by: -arch
2002-09-21 01:28:41 +00:00
mike
8286a42d54 Fix an error which prevented ssize_t from becoming defined. Add
restrict type-qualifier.
2002-09-20 08:22:48 +00:00
peter
129e34b9ef Add dev/iicbus and dev/smbus to LSUBDIRS list 2002-09-19 03:28:52 +00:00
alfred
aab026ffb7 Install _semaphore.h. 2002-09-19 01:13:31 +00:00
mike
b2e82fa6e3 style(9): tab after #define. 2002-09-18 22:23:59 +00:00
mike
2db6065cba o Don't include <nl_types.h>, instead provide a typedef for nl_item.
o Use relatively new visibility primitives to conditionalize some
  constants.
2002-09-18 05:54:25 +00:00
mike
24c9e9c707 Move definition of nl_item type to <sys/_types.h>, so that it can be
shared.
2002-09-18 05:51:23 +00:00
mike
4a39538d4e Use relatively new visibility primitives for conditionals. Document
unimplemented functions.
2002-09-18 02:07:08 +00:00
mike
b5274ecd26 style(9): line up function names 2002-09-17 22:39:43 +00:00
mike
086f36bd96 Use the relatively new visibility primitives for conditionals. 2002-09-17 22:25:40 +00:00
peter
a51c9b6627 Initiate deorbit burn for the i386-only a.out related support. Moves are
under way to move the remnants of the a.out toolchain to ports.  As the
comment in src/Makefile said, this stuff is deprecated and one should not
expect this to remain beyond 4.0-REL.  It has already lasted WAY beyond
that.

Notable exceptions:
gcc - I have not touched the a.out generation stuff there.
ldd/ldconfig - still have some code to interface with a.out rtld.
old as/ld/etc - I have not removed these yet, pending their move to ports.
some includes - necessary for ldd/ldconfig for now.

Tested on: i386 (extensively), alpha
2002-09-17 01:49:00 +00:00
tjr
8569d04e14 Add wcstod() as a wrapper around strtod(). It does not handle any characters
that strtod() does not (alternate digit characters, etc. are not handled).
2002-09-15 08:38:51 +00:00
tjr
853cbada66 Style: tab between #define and macro name. 2002-09-12 23:33:17 +00:00
tjr
c6cbf33b5a Protect arguments to the putwc and putwchar macros with parens. 2002-09-12 10:27:48 +00:00
tjr
5f5cd9d0b8 Add an implementation of wcsftime() (wide character version of strftime()). 2002-09-11 08:57:11 +00:00
mike
c19bfb71ea Conditionalize some objects to match the functions that they are used
with.  Enable `restrict' type-qualifier.
2002-09-11 05:04:06 +00:00
mike
416d785654 Fix some style bugs:
o Space used instead of a tab after `#define' and `typedef'.
o Sentences not ended with a period.
o Unaligned function names and other spacing issues.
2002-09-10 18:41:45 +00:00
mike
520d2c38c6 Fix namespace issues by using the relatively new visibility
primitives.
2002-09-10 18:12:16 +00:00
tjr
80df78435a Replace FILE with struct __sFILE in the prototypes for the wide character
I/O functions to avoid having to bring in pollution from <stdio.h>.

Suggested by:	bde
2002-09-10 09:43:28 +00:00
wollman
3c4b3f0c50 Without fixing the namespace issues, add prototypes for the new _Exit()
and qsort_r() functions.  Fix one other missorted declaration.
2002-09-10 02:02:49 +00:00
tjr
7ca7dd3e03 Remove the typedef of wctype_t from this header; we don't support the
XSI mistake of making everything from <wctype.h> visible here.
If we did choose to support it, we could just #include <wctype.h>.
2002-09-09 07:17:55 +00:00
mike
c80d532f6e Solve the <runetype.h> pollution problem by disabling inline
optimizations when a standard has been requested, except when the
inline optimizations are also specifically requested.
2002-09-09 05:38:05 +00:00
mike
b51ae9f1d2 style(9): line up function names. 2002-09-09 03:52:43 +00:00
tjr
7c848d9cfd Add wcstol() and wcstoul(), based on strtol() and strtoul(). 2002-09-08 13:27:26 +00:00
tjr
9445b1b57c Add an implementation of wcstok(), based on strtok_r(). 2002-09-07 08:16:57 +00:00
tjr
a0ad34a541 Add restrict qualifiers to wcsstr()'s arguments. 2002-09-07 03:38:13 +00:00
tjr
cd5ca96599 Style: One space between "restrict" qualifier and "*". 2002-09-06 11:24:06 +00:00
mike
bd35b3e920 o Fix namespace scope issues in <ctype.h> by using the relatively new
visibility primitives.
o Implement _tolower() and _toupper() POSIX.1-2001 (XSI) macros in
  <ctype.h>.
o Reduce pollution in <runetype.h> by removing typedefs and using
  implementation namespaced types.
o Add a typedef in <rune.h> to compensate for <runetype.h> losing its
  typedefs.

Reviewed by:	bde
2002-09-06 04:22:54 +00:00
alfred
d049443a42 remove #pragma ident 2002-09-04 23:58:23 +00:00
mike
8998ff49da Now that _BSD_CLK_TCK_ and _BSD_CLOCKS_PER_SEC_ are the same on all
architectures, move the definition directly into <time.h> and finish
the removal of <machine/ansi.h>.
2002-09-03 00:06:58 +00:00
mike
31fdc63e0e Be more explicit about a namespace by using the relatively new
visibility primitives.
2002-09-01 17:57:20 +00:00
tjr
2e5584e864 Add restrict qualifiers to the arguments of mbstowcs, mbtowc() and
wcstombs().
2002-09-01 07:08:22 +00:00
mike
c38d8bf811 Add time_t typedef for POSIX compatibility, move an include. 2002-08-24 00:11:52 +00:00
peter
c465eaa584 Use sys/nlist_aout.h for shared-with-kernel definitions. 2002-08-22 20:37:57 +00:00
peter
e31269938a Use sys/link_elf.h or sys/link_aout.h based on compile environment 2002-08-22 20:37:30 +00:00
mike
9e6f796b0d o Merge <machine/ansi.h> and <machine/types.h> into a new header
called <machine/_types.h>.
o <machine/ansi.h> will continue to live so it can define MD clock
  macros, which are only MD because of gratuitous differences between
  architectures.
o Change all headers to make use of this.  This mainly involves
  changing:
    #ifdef _BSD_FOO_T_
    typedef	_BSD_FOO_T_	foo_t;
    #undef _BSD_FOO_T_
    #endif
  to:
    #ifndef _FOO_T_DECLARED
    typedef	__foo_t	foo_t;
    #define	_FOO_T_DECLARED
    #endif

Concept by:	bde
Reviewed by:	jake, obrien
2002-08-21 16:20:02 +00:00
tjr
a79225f8d0 Restrict visibility of wcwidth() and wcswidth(); they are XSI extensions. 2002-08-20 22:44:40 +00:00
ache
86ecb5818b Sort unsorted prototypes 2002-08-19 21:00:13 +00:00
ache
426d833605 Activate (uncomment) wcwidth() and wcswidth() now implemented 2002-08-19 20:48:18 +00:00
ache
f70b854cde Move internal defines from here to libc/locale/wcwidth.c 2002-08-19 08:58:51 +00:00
ache
d80df77aeb Properly define SWIDTH1, add autowidth (was SWIDTH1) 2002-08-19 08:50:41 +00:00
tjr
a87152b560 Implement the ISO C90 Amd.1 restartable wide and multibyte character
manipulation functions mbrlen(), mbrtowc(), mbsinit(), mbsrtowcs(),
wcrtomb(), wcsrtombs().
2002-08-18 06:30:10 +00:00
mike
1f81bb0282 Change a POSIX conditional to use the new __BSD_VISIBLE macro.
Fix the following style bugs:
o #ifdef, #ifndef, and #undef should be followed by a space, not a
  tab.
o The second level of indentation in prototypes is 4 characters even
  when the function names are indented 1 extra character.
o Type qualifiers that appear next to a * need a seperating space so
  that the qualifier isn't easily confused with parameter names.
  (eg. `char * __restrict' instead of `char *__restrict')

Submitted by:	bde (mostly)
2002-08-16 16:34:26 +00:00
keichii
74943c8903 Add swidth definition for wchar stuff
Submitted by:	clkao@clkao.org
Reviewed by:	keichii
Obtained from:	NetBSD
MFC after:	1 month
2002-08-16 13:42:59 +00:00
alfred
9c6aa2dcd8 add a check for GNUC < 3 to typedef bool because gcc 3 always seems to
define it.

Suggested by: tjr
2002-08-16 07:33:14 +00:00
robert
eef3b2f04b - For compliance with IEEE Std 1003.1-2001, add the 'restrict'
qualifier to function prototypes and definitions where
   appropriate using the '__restrict' macro.
 - Update the manual page.
2002-08-15 10:28:52 +00:00
robert
4accb821f1 - Introduce the 'restrict' qualifier to function prototypes and
definitions to comply with IEEE Std 1003.1-2001.
 - Update the manual pages.
2002-08-15 09:47:10 +00:00
robert
043ed1f581 - Add the 'restrict' qualifier to the function prototypes and
definitions of the functions that convert strings to numbers
   and are defined by IEEE Std 1003-1.2001.
 - Use ANSI-C function definitions for all of the functions
   mentioned above plus strtouq and strtoq.
 - Update the prototypes in the manual pages.
2002-08-15 09:25:04 +00:00
robert
4b64f84a43 - Add the 'restrict' qualifier to the function definitions and
public prototypes of setbuf(3) and setvbuf(3) using the
   '__restrict' macro from <sys/cdefs.h> to be compliant with
   IEEE Std 1003.1-2001.
 - Replace the K&R with ANSI-C function definitions.
 - Bring the manual page up-to-date.
2002-08-14 23:45:42 +00:00
robert
f0abd50e99 - Add the 'restrict' qualifier to the function definition of
strftime(3) for IEEE Std 1003.1-2001 compliance and remove
   excessive usage of the 'const' qualifier that was neither
   present in the prototype in the publice header, nor in the
   local prototype just above the function definition.
 - Replace the K&R function definition with a ANSI-C one.
 - Update the prototype of strftime(3) in its manual page.
2002-08-14 23:20:48 +00:00
robert
6e77bfc7bd - Add the C99 'restrict' qualifier using the '__restrict' macro to
function prototype and definition of strptime(3).
 - Update the manual page.
2002-08-14 22:36:22 +00:00
robert
d02311a4f8 - Add the 'restrict' qualifier to match the IEEE Std 1003.1-2001
prototype of the tdelete(3) function.
 - Remove duplicated space.
 - Use an ANSI-C function definition for tdelete(3).
 - Update the manual page.
2002-08-14 21:16:41 +00:00
robert
af770662f5 -Add the restrict required by IEEE Std 1003.1-2001 in form
of our __restrict macro to the prototypes and function
   definitions of inet_pton and inet_ntop.
 - Use ANSI-C function argument lists.
 - Adjust the prototypes in the manual page.
2002-08-14 20:40:35 +00:00
tjr
294097ed71 Basic support for wide character I/O: getwc(), fgetwc(), getwchar(),
putwc(), fputwc(), putwchar(), ungetwc(), fwide().
2002-08-13 09:30:41 +00:00
mike
a72d8585b7 Implement POSIX.1-2001 (XSI)'s ulimit(3).
Submitted by:	Kyle Martin <mkm@ieee.org>
2002-08-08 04:50:36 +00:00
tjr
2fbfd25f94 Sort prototypes by function name. 2002-08-06 06:26:06 +00:00
tjr
464f6c7f7e Whitespace formatting changes: line up macro bodies, function names,
place tabs after #define and typedef. Sort typedefs by name.

Requested by:	mike
2002-08-06 05:19:33 +00:00
mike
21798e4a9c Fix some style bugs.
Submitted by:	bde
2002-08-05 16:37:05 +00:00
tjr
5b91013415 Implement the missing <wctype.h> functions: isw*() (iswalnum() etc.),
towlower() and towupper() required by ISO C90 Amd. 1.

iswascii(), iswhexnumber(), iswideogram(), iswnumber(), iswphonogram(),
iswrune() and iswspecial() have also been implemented for consistency
with the BSD extensions in <ctype.h>.
2002-08-05 10:45:23 +00:00
mike
6173b2ee76 Implement POSIX.1-2001 (XSI)'s fmtmsg(3). 2002-08-05 06:49:58 +00:00
tjr
2e02b2970d Change wctype_t to an unsigned type to avoid warnings. 2002-08-04 12:43:53 +00:00
tjr
c7dfca65ec Add the ISO C90 Amd. 1 wctrans(3) and towctrans(3) functions. 2002-08-04 12:09:08 +00:00
tjr
eefed45007 Add ISO C90 Amd. 1 btowc(3) and wctob(3) functions. 2002-08-03 13:49:55 +00:00
tjr
2ddf585cad Add ISO C90 Amd. 1 wctype(3) and iswctype(3) functions. 2002-08-03 04:18:40 +00:00
rwatson
5db6965289 Install MAC policy include files as part of the normal includes
install.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs
2002-08-02 06:56:26 +00:00
mike
aeb3f4a795 Implement the POSIX.1-2001 (XSI) header, <cpio.h>. 2002-08-01 07:18:38 +00:00
robert
e3955115b6 Remove duplicated '__BEGIN_DECLS' which obviated compiling
C++ sources that use this header.

Reported by:	Jan Stocker <Jan.Stocker@t-online.de>
2002-07-21 20:37:58 +00:00
mikeh
cd0195b666 Update glob(3) to add all the POSIX required options, specifically:
- add GLOB_NOMATCH return value and use it when we don't get a match
- rename GLOB_ABEND to GLOB_ABORTED and use it instead of returning 1
  in some places
- add GLOB_NOESCAPE flag and retire GLOB_QUOTE to compatibility
  section

Suggestions/advice on correct usage of POSIX defines: wollman
2002-07-17 04:58:09 +00:00
mckusick
3abb526f86 Change utimes to set the file creation time (for filesystems that
support creation times such as UFS2) to the value of the
modification time if the value of the modification time is older
than the current creation time. See utimes(2) for further details.

Sponsored by:	DARPA & NAI Labs.
2002-07-17 02:03:19 +00:00
wollman
f62ac07676 Support POSIX/SUS ``programming environment'' mistake in confstr(). 2002-07-15 22:21:33 +00:00
wollman
e52f5b3dbc Move _CS_PATH from <sys/unistd.h> to <unistd.h> -- the kernel isn't involved
in confstr() processing.
2002-07-15 21:56:40 +00:00
wollman
859a07fe0d getopt(3) was also added in 1003.2-1992. 2002-07-15 21:32:45 +00:00
wollman
b89239acdb Fix visibility:
- symlink() is from 1003.1-2001 and XPG4.2
- fchown() is from 1003.1-2001
- fsync() is from ISO/IEC 9945-1:1995
- confstr() is from 1003.2-1992
2002-07-15 20:33:58 +00:00
wollman
c559b89027 Clean up some of the rather strange structure and ordering of this
file.  Correct visibility conditions and order blocks of declarations
in order of increasing inclusiveness.  Note that [v]snprintf() is now
in ISO C and f{seek,tell}o() are now in POSIX.  Deprecated getw() and
putw() are no longer visible in XSH6 namespace (and should probably
be removed from BSD namespace as well).
2002-07-15 19:38:45 +00:00
alfred
11274ff2e6 clnt_vc_create() has const scalar arguments that wind up being modified,
fix it (make them non-const) and update the associated documentation.

Submitted by: mbr
2002-07-14 23:35:04 +00:00
sobomax
a81ce47daa Correct _PATH_RCP to be /bin/rcp, not /usr/bin/rcp. 2002-07-14 13:04:15 +00:00
alfred
5b169b54b8 Add functions allowing for the user to specify a timeout for rpc functions.
Update copyrights to reflect where this code was lifted from. (tirpc '99)

Submitted by: mbr
2002-07-11 16:23:04 +00:00