Commit Graph

1150 Commits

Author SHA1 Message Date
Doug Barton
7fd268cce6 goto break; != break;
I've no idea if this is the right behavior for the library, but this
at least fixes the build, and matches what seems to be alfred's intent
in the commit message for 1.19.
2002-11-17 08:54:29 +00:00
Alfred Perlstein
f51c1e897d Rework the sysconf(3) interaction with aio:
sysconf.c:
  Use 'break' rather than 'goto yesno' in sysconf.c so that we report a '0'
  return value from the kernel sysctl.

vfs_aio.c:
  Make aio reset its configuration parameters to -1 after unloading
  instead of 0.

posix4_mib.c:
  Initialize the aio configuration parameters to -1
  to indicate that it is not loaded.
  Add a facility (p31b_iscfg()) to determine if a posix4 facility has been
  initialized to avoid having to re-order the SYSINITs.
  Use p31b_iscfg() to determine if aio has had a chance to run yet which
  is likely if it is compiled into the kernel and avoid spamming its
  values.
  Introduce a macro P31B_VALID() instead of doing the same comparison over
  and over.

posix4.h:
  Prototype p31b_iscfg().
2002-11-17 04:15:34 +00:00
Alfred Perlstein
3d8ce33a50 Provide more correct default values for sysconf(3) reporting of the AIO
subsystems capabilities:

_SC_AIO_LISTIO_MAX returns the default of _POSIX_AIO_LISTIO_MAX
_SC_AIO_MAX returns the default _POSIX_AIO_MAX
_SC_AIO_PRIO_DELTA_MAX returns the default of 0

Without these adjustments the values returned are -1 even when the
aio side of the kernel returns '0' for them which is incorrect.

Noticed by: Craig Rodrigues <rodrigc@attbi.com>
2002-11-16 06:35:20 +00:00
Ruslan Ermilov
bedff4e805 Reset LogTag to NULL in closelog(3). This fixes mysterious crashes
caused by dynamic PAM modules that call openlog(3) and closelog(3),
e.g. ports/security/pam_pwdfile.

What happened here is that the module first registered its "ident"
with openlog(3), then PAM library unloaded module with dlclose(3),
and the next call to syslog(3) resulted in SIGSEGV.

MFC after:	3 days
2002-11-14 12:40:14 +00:00
Daniel Eischen
fcfc20c88a Argh, change declaration of two-dimensional array so that it actually
builds.
2002-11-13 21:55:22 +00:00
Daniel Eischen
fb22a377c6 Use a jump table (a la Solaris) for pthread routines with default
entries in the table being stubs.  While I'm here, add macros to
auto-generate the stubs.  A conforming threads library can override
the stub routines by filling in the jump table.

Add some entries to namespace.h and sync un-namespace.h to it.
Also add a comment to remind folks to update un-namespace.h
when changing namespace.h.
2002-11-13 18:12:09 +00:00
Doug Rabson
ceb336710e * Add stubs for pthread_cond_broadcast.
* Fix typos in rwlock stubs.
* Add pthread_XXX counterparts to the _pthread_XXX stubs which libraries
  like libX11 can use to ensure thread-safety without requiring the use
  of a thread library.

Submitted by: Terry Lambert (pthread_cond_broadcast)
Reviewed by: deischen
2002-11-01 09:37:17 +00:00
Garrett Wollman
c9885518de Create a small library function, check_utility_compat(3), to determine
whether a named utility should behave in FreeBSD 4.x-compatible mode
or in a standard mode (default standard).  The configuration is done
malloc(3)-style, with either an environment variable or a symlink.

Update expr(1) to use this new interface.
2002-10-28 00:15:43 +00:00
Garrett Wollman
188c541ceb Update limits and configuration parameters for 1003.1/TC1/D6.
Implement new sysconf keys.  Change the implenentation of
_SC_ASYNCHRONOUS_IO in preparation for the next set of changes.

Move some limits which had been in <sys/syslimits.h> to <limits.h> where
they belong.  They had only ever been in syslimits.h to provide for the
kernel implementation of the CTL_USER MIB branch, which went away with
newsysctl years ago.  (There is a #error in <sys/syslimits.h> which I
will downgrade in the next commit.)
2002-10-27 18:03:02 +00:00
Mark Murray
d69d15193c Make the first argument of getbsize a size_t* instead of an int*, as this is what the quantity actually is. Fix an easy const while I'm here. 2002-10-23 14:18:07 +00:00
Tim J. Robbins
67c3339291 The ftok() function has not been in libcompat for quite a while. 2002-10-19 13:33:12 +00:00
Mark Murray
08076c086f Oops. Also provide a lint-compatible unused argument warning killer. 2002-10-18 16:24:20 +00:00
Mark Murray
6b83b5cdb8 ISOfy functions, sort headers and mark unused arguments. 2002-10-18 16:22:13 +00:00
Tim J. Robbins
185b9d1c2c Add a Bugs section and note that fmtcheck() is out of sync with printf();
it does not recognise any of the conversions or modifiers added in C99.
2002-10-16 04:03:02 +00:00
Mike Barcroft
54e4e385de Add restrict type-qualifier. 2002-10-12 16:13:41 +00:00
Maxim Konovalov
65edeb2358 Do not allow empty GIDs for non-NIS entries.
MFC after:	2 weeks
2002-10-11 11:35:30 +00:00
Peter Wemm
cf9f968444 Drop almost 3k from /bin/sync by moving errno to a seperate file
to avoid all syscalls pulling in sys_errlst[].

Noted by:  bde
2002-10-09 08:04:24 +00:00
Mike Barcroft
ddb4fb5b44 Add restrict type-qualifier to sem_getvalue(). 2002-10-04 21:32:00 +00:00
Maxim Konovalov
9b7c7ff8ce Too strict error checking in rev. 1.22 broke pwd_mkdb(8) in NIS
environment. An empty UID and GID are valid there.

Spotted by:	rwatson
2002-10-02 07:02:46 +00:00
Maxim Konovalov
05a7daf5ca Disqualify UID/GID with non-numeric character.
PR:		bin/41721
Reviewed by:	tjr, silence on -audit
MFC after:	2 weeks
2002-09-25 08:49:19 +00:00
Garrett Wollman
0b32a813fa Initiate deorbit burn sequence for sysctl CTL_USER MIB branch.
Use the correct constants directly from sysconf() rather than calling
sysctl() to tell us the (still compiled-in) value.  Leave the CTL_POSIX1B
stuff alone for now (but I'd like to see this replaced with a single
structure returning all of the relevant information).

Implement all of the keys from 1003.1-2001 that we can.  Ensure that
the build will break if someone redefines an option constant to zero
without implementing the necessary presence-detection logic here.

(4 of 5)
2002-09-21 02:14:04 +00:00
Garrett Wollman
0d3bcc2e80 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
Jonathan Mini
4ed3c94b61 Don't peek into MD structures from MI code. The getcontext(3) and
setcontext(3) functions check the validify of the mcontext_t structs.
2002-09-20 08:13:21 +00:00
Garrett Wollman
4b85f43b30 Return the correct environment name for 64-bit platforms in the
_CS_POSIX_V6_WIDTH_RESTRICTED_ENVS case.
2002-09-19 03:47:36 +00:00
Alfred Perlstein
bf4dc8772e Welcome the sem_ API to libc! 2002-09-19 01:14:08 +00:00
Alfred Perlstein
4f68734dc6 add a stub for pthread_cond_destroy. 2002-09-19 01:09:49 +00:00
Peter Wemm
6064ca520a Bandaid to stop failing on non-i386 platforms.
Add a big ugly #warning as a reminder.
2002-09-17 06:22:51 +00:00
Peter Wemm
66422f5b7a 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
Jonathan Mini
b3466b3fe0 Add signalcontext(), which lays down a signal frame onto a ucontext_t.
Reviewed by:	deischen, julian
Approved by:	-arch
2002-09-16 19:23:35 +00:00
Archie Cobbs
a892767bc4 Add man pages for getcontext()/setcontext(), makecontext()/swapcontext(),
and ucontext_t.

Reviewed by:	mini
MFC after:	3 days
2002-09-11 21:39:21 +00:00
Mike Barcroft
a4a96c8166 Add `restrict' type-qualifier. 2002-09-11 05:05:48 +00:00
Garrett Wollman
f882c94f2b Fix a syntax error which causes an annoying warning. 2002-09-08 04:43:28 +00:00
Juli Mallett
1bd5f7392d Two arrays were born from the same seeds, both grew into complementary sets
of pointers to strings.  These two arrays were fixed to the same size, but one
had an implicit zeroed trailer element, which was unused because the size was
used up by the ones before said zeroed trailer element.  So the unused limb was
chopped off the over-sized-but-not-over-sized array, and everyone lived happily
ever after.
2002-09-07 08:14:19 +00:00
Tim J. Robbins
58d38e2520 Style: One space between "restrict" qualifier and "*". 2002-09-06 11:24:06 +00:00
Mike Barcroft
800563c573 Fix a memory leak. 2002-09-01 01:49:27 +00:00
Mike Barcroft
7ab2cd8c38 Note that <sys/types.h> in no longer a prerequisite for <utime.h> and
<sys/mman.h>.
2002-08-24 00:39:43 +00:00
Poul-Henning Kamp
bb7d71b99f s/EDOFUS/EDOOFUS/
Persuaded by:	Google
2002-08-21 17:11:00 +00:00
Juli Mallett
a10a751f68 s/trailing NULL/trailing NUL/ 2002-08-19 17:14:58 +00:00
Bosko Milekic
b8606fe660 Fix libc build breakage by defining FSTYPENAMES before including
disklabel.h; broken originally by 1.87 of sys/disklabel.h, which
made the split between DKTYPENAMES and FSTYPENAMES.
Someone who knows disklabel.c: do we still need DKTYPENAMES to be
defined here now?
2002-08-16 15:33:20 +00:00
Ruslan Ermilov
e091d0c2ac can not -> cannot. 2002-08-13 14:10:36 +00:00
David Malone
3ab539dcb4 Add a missing copyright for Doug. There are other files missing this
copyright in -stable.

PR:		41397
Submitted by:	dfr
2002-08-11 19:31:02 +00:00
Jens Schweikhardt
2b239dd118 Fix typos; each file has at least one s/seperat/separat/
(I skipped those in contrib/, gnu/ and crypto/)
While I was at it, fixed a lot more found by ispell that I
could identify with certainty to be errors. All of these
were in comments or text, not in actual code.

Suggested by:	bde
MFC after:	3 days
2002-08-11 13:05:30 +00:00
Maxime Henrion
5965373e69 - Introduce a new struct xvfsconf, the userland version of struct vfsconf.
- Make getvfsbyname() take a struct xvfsconf *.
- Convert several consumers of getvfsbyname() to use struct xvfsconf.
- Correct the getvfsbyname.3 manpage.
- Create a new vfs.conflist sysctl to dump all the struct xvfsconf in the
  kernel, and rewrite getvfsbyname() to use this instead of the weird
  existing API.
- Convert some {set,get,end}vfsent() consumers to use the new vfs.conflist
  sysctl.
- Convert a vfsload() call in nfsiod.c to kldload() and remove the useless
  vfsisloadable() and endvfsent() calls.
- Add a warning printf() in vfs_sysctl() to tell people they are using
  an old userland.

After these changes, it's possible to modify struct vfsconf without
breaking the binary compatibility.  Please note that these changes don't
break this compatibility either.

When bp will have updated mount_smbfs(8) with the patch I sent him, there
will be no more consumers of the {set,get,end}vfsent(), vfsisloadable()
and vfsload() API, and I will promptly delete it.
2002-08-10 20:19:04 +00:00
Ruslan Ermilov
760d968629 mdoc(7) police: laundry. 2002-08-09 11:06:03 +00:00
Poul-Henning Kamp
9d6d1ee63e Introduce a new error return code:
#define EDOFUS          88              /* Programming error */
This can be used to signal error situations which indicate that the
program logic or assumptions is deficient.
2002-08-09 10:15:48 +00:00
Mike Barcroft
af8c0bce98 Implement POSIX.1-2001 (XSI)'s ulimit(3).
Submitted by:	Kyle Martin <mkm@ieee.org>
2002-08-08 04:50:36 +00:00
Mike Barcroft
0f1bfcd283 o Fix a memory leak.
o Rewrite validmsgverb() so that it works (I'm not sure how it escaped
  my original testing).
o Document nextcomp().
2002-08-05 19:36:09 +00:00
Mike Barcroft
823f68a28a Implement POSIX.1-2001 (XSI)'s fmtmsg(3). 2002-08-05 06:49:58 +00:00
Mike Heffner
4a59c3ab55 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
Garrett Wollman
020d4fa6de Don't ask me how I consistently turned struct statvfs into struct vfsconf.... 2002-07-16 20:40:12 +00:00
Garrett Wollman
252724764d Assume that my bug report against 1003.1-2001 will be resolved my way,
and make 64-bit architectures use the LP64_OFF64 environment instead
of the LPBIG_OFFBIG one.
2002-07-15 22:43:03 +00:00
Garrett Wollman
603a6e79d8 Support POSIX/SUS ``programming environment'' mistake in confstr(). 2002-07-15 22:21:33 +00:00
Garrett Wollman
97ec79a175 All of the things that confstr() returns are compile-time constants.
It's silly to call sysctl() to get the value of _PATH_STDPATH from
<paths.h> when we can just use it directly.  This greatly simplifies
the implementation.  (This is also part of my grand scheme to get
rid of sysctl's `user' category, which should never have been created.)

Use strlcpy() instead of strncpy() as it has the exact semantics we want.
2002-07-15 21:51:19 +00:00
Garrett Wollman
45d2fcfaae Don't bother asking the kernel about _SC_FSYNC; it's not optional. 2002-07-15 20:42:05 +00:00
Garrett Wollman
d04f03fc63 Fix a few bugs in the ERRORS section. 2002-07-13 19:38:59 +00:00
Garrett Wollman
6e97e157e8 Add statvfs(3) to the build.
Tested by:	Steve Kargl
2002-07-13 19:33:20 +00:00
Garrett Wollman
b3928a066a Well, it's not quite strxfrm(3) but at least it's honest. 2002-07-13 19:29:44 +00:00
Giorgos Keramidas
079167d6d7 Various typo fixes.
PR:		docs/39395
Submitted by:	Rich Neswold <rneswold@ameritech.net>
2002-07-12 01:30:18 +00:00
Garrett Wollman
4f6799e61e A simple implementation of statvfs(3) (one step above the trivial one).
Not yet connected to the build (awaiting documentation).
2002-07-11 22:54:11 +00:00
Chris Costello
05ddd41b23 Move appropriate information out of DESCRIPTION' and into SECURITY
CONSIDERATIONS'.

Sponsored by:	DARPA, NAI Labs
2002-07-03 15:31:47 +00:00
Daniel Eischen
eee80fbd9c Remove pselect from application namespace and instead use a weak reference
to the actual implementation.  This is to allow libc_r to override
pselect() making it a cancellation point.

Prompted by: wollman
2002-06-27 13:23:46 +00:00
Daniel Eischen
53154da089 Remove improper use of <namespace.h>.
Remove fmtcheck from application name space (fix the weak reference).
2002-06-27 13:20:54 +00:00
Garrett Wollman
50d0eead10 Actually document pselect(3) so that Bruce can mention it in the release
notes. :-)
2002-06-17 02:21:17 +00:00
Garrett Wollman
7d0f66cbc3 Add pselect(3) to the build. Need to figure out the most appropriate
way to document this interface.
2002-06-15 23:42:59 +00:00
Garrett Wollman
fda2301943 Since POSIX gives us plenary authority to define _t types, change
__dlfunc_t to dlfunc_t to match what I have proposed to the Austin
Group.  (This also makes it easier for applications to store these
values before they decide what to do with them, e.g., in a wrapper
function.)
2002-05-29 19:35:13 +00:00
Garrett Wollman
2b8a42d55c Add link dlopen(3) -> dlfunc(3).
Reminded by:	mike
2002-05-29 17:38:42 +00:00
Garrett Wollman
dc12134a80 Reorganize dlfcn.h slightly to separate out XSI and BSD interfaces.
Add new dlfunc() interface, which is a version of dlsym() with a
return type that can be cast to a function pointer without turning
your computer into a frog.

Reviewed by:	freebsd-standards
2002-05-29 16:25:43 +00:00
Alfred Perlstein
a82bbc730e Assume __STDC__, remove non-__STDC__ code.
Submitted by: keramida
2002-05-28 17:03:12 +00:00
Jake Burkholder
cae52cb693 These files are no longer used. 2002-05-24 04:41:02 +00:00
Jake Burkholder
530622075e Generate the normal asm stubs for all sysv system calls. Use these instead
of C wrappers for the *sys indirect system calls.  The indirect system calls
are horribly broken on sparc64.

Submitted by:	tmm
2002-05-23 23:51:57 +00:00
Poul-Henning Kamp
77068a7fe2 Retire the bogus uses of the disklabel field d_sbsize and begin to
initialize it to zero so we don't have to have everbody and their
aunt including FFS specific header files.

Sponsored by: DARPA & NAI Labs.
2002-05-12 20:49:41 +00:00
Josef Karthauser
1063e12617 Replace /kernel with /boot/kernel/kernel.
PR:		docs/37757
Submitted by:	Hiten Pandya <hiten@uk.FreeBSD.org>
2002-05-09 11:47:42 +00:00
Dag-Erling Smørgrav
719137a64d Fix bug that causes passwd and friends to fail when the user has a '+' in
their passwd file for NIS because _PWF_SOURCE is not set.

Submitted by:	amigus (perforce change 10969)
2002-05-07 23:26:00 +00:00
Dag-Erling Smørgrav
73c9eb2fbf #include <string.h> instead of <strings.h> 2002-04-25 18:14:39 +00:00
Josef Karthauser
d2c0ac28da Support the snapshot file flag, so that tools like 'ls -ol' work
as expected on snapshot files.

PR:		bin/37038
Submitted by:	Joshua Goodall <joshua@roughtrade.net>
2002-04-16 11:03:22 +00:00
Dag-Erling Smørgrav
00d9b6b8d6 Missed a spot in previous commit.
Sponsored by:	DARPA, NAI Labs
2002-04-15 00:21:25 +00:00
Dag-Erling Smørgrav
e479b601dd (ab)use unused bits in the pw_fields member of struct passwd to record
the source of the data contained in the structure.

Sponsored by:	DARPA, NAI Labs
2002-04-14 22:24:55 +00:00
Ruslan Ermilov
c3e3cbe16e No longer needed to #ifdef __FBSDID, this is now handled by Makefile.inc1. 2002-04-09 11:39:05 +00:00
Poul-Henning Kamp
674a5ae34f Catch up with const'ification of <sys/disklabel.h> and quelch warnings. 2002-04-08 08:57:21 +00:00
Poul-Henning Kamp
6a263fa41d Initial deorbit burn for the undocumented and unused d_boot[01]
fields of struct disklabel.

Sponsored by: DARPA and NAI Labs.
2002-04-03 15:44:53 +00:00
Mark Murray
4cd0119367 Do not use __progname directly (except in [gs]etprogname(3)).
Also, make an internal _getprogname() that is used only inside
libc. For libc, getprogname(3) is a weak symbol in case a
function of the same name is defined in userland.
2002-03-29 22:43:43 +00:00
Bruce Evans
514a0ae7d2 Fixed some style bugs in the removal of __P(()). Some function parameter
lists were outdented to column 0.
2002-03-26 01:35:05 +00:00
Dima Dorfman
e10bdff354 A break after a return is useless. 2002-03-24 08:38:21 +00:00
Dima Dorfman
3afe2c7806 Fix braino. 2002-03-24 06:30:28 +00:00
Warner Losh
bb28f3c29b Breath deep and take __P out of the system include files.
# This appears to not break X11, but I'm having problems compiling the
# glide part of the server with or without this patch, so I can't tell
# for sure.
2002-03-23 17:24:55 +00:00
David E. O'Brien
1114a754ed Fix the style of the SCM ID's.
I believe have made all of libc .h's as consistent as possible.
2002-03-22 23:42:05 +00:00
David E. O'Brien
333fc21e3c Fix the style of the SCM ID's.
I believe have made all of libc .c's as consistent as possible.
2002-03-22 21:53:29 +00:00
David E. O'Brien
1372519b15 Remove multi-line __P() usage. 2002-03-22 09:22:15 +00:00
Warner Losh
80578e902c const poison just like NetBSD. 2002-03-22 02:43:01 +00:00
Warner Losh
ae10a3fcce Make user_from_uid and group_from_gid return const char *, just like
NetBSD.  Update man page to reflect this.
2002-03-22 02:35:47 +00:00
David E. O'Brien
c05ac53b8b Remove __P() usage. 2002-03-21 22:49:10 +00:00
Peter Wemm
cc2dbb21e5 Move swapcontext.c to the ${MACHINE_ARCH}/gen/Makefile.inc area, otherwise
it causes undefined references to getcontext() and setcontext() on
platforms other than i386 and alpha.
2002-03-21 06:45:32 +00:00
Dima Dorfman
1dd9f42a29 mdoc(7) police: bump document date to the date of the last interface
change (revision 1.2 of devname.c on 1999/07/18), don't put quotes
around a path, and use .Dv where appropriate.
2002-03-18 02:36:43 +00:00
Dima Dorfman
f04938aa8e Update to reflect reality; devname(3) hasn't returned NULL on failure
since revision 1.2 of devname.c (1999/07/18).  While I'm here, note,
in the BUGS section, that the returned pointer is to a static buffer.
2002-03-18 02:32:53 +00:00
Ruslan Ermilov
f3a90e8782 Come on guys, you can't just take OpenBSD manpage and commit it
over someone else's fixes; this is at least offensive.  If you
have problems doing a proper merge, we are here, your fellow
committers.  :-(

Reapply markup fixes from revision 1.2 and fix some more.  Also
fix the $OpenBSD$ tag.
2002-03-15 17:46:53 +00:00
David Malone
94998878b7 If syslog fails to talk to syslogd, then it tries to write a message
to the console in a final attempt to log something. Make this final
attempt non-blocking so that a blocking console doesn't end up
blocking process which attempt to syslog something.

In particular, this means you should be able to su and fix the
problem if the console becomes blocking.

MFC after:	3 weeks
2002-03-09 11:38:01 +00:00
Dima Dorfman
ca4b6b3910 This API will appear in FreeBSD 4.6. 2002-03-09 05:19:21 +00:00
Dima Dorfman
235d6772d5 Bring a comment in line with the code, and fix some spelling errors
while I'm here.

PR:		35394
Submitted by:	andrew@ugh.net.au
2002-03-09 04:00:53 +00:00
Brian Feldman
44f7d6af24 Fix build. I commented out getpass() in readpassphrase.c because the
implementation did not match our manpage description (i.e., it could
return NULL).  I mistakenly thought we were still using getpass.c
because, for some reason, CVS never removed it from the tree.

Pointy hat received from:	alfred
Kick in the groin to:	CVS
2002-03-09 03:16:41 +00:00
Brian Feldman
a7a8a766e7 Update readpassphrase(3)to the latest revisions. Changes are mainly due
to return value constraints now changing as well as more intelligent
handling of signals.

Obtained from:	OpenBSD
2002-03-08 21:14:00 +00:00
Brian Feldman
9d9737ecb2 Add new errno ``ENOATTR''. 2002-03-07 15:13:44 +00:00
Dima Dorfman
76183f3453 Introduce a version field to `struct xucred' in place of one of the
spares (the size of the field was changed from u_short to u_int to
reflect what it really ends up being).  Accordingly, change users of
xucred to set and check this field as appropriate.  In the kernel,
this is being done inside the new cru2x() routine which takes a
`struct ucred' and fills out a `struct xucred' according to the
former.  This also has the pleasant sideaffect of removing some
duplicate code.

Reviewed by:	rwatson
2002-02-27 04:45:37 +00:00
Alfred Perlstein
ef18a7a841 use _GENERIC_DIRSIZ(dp) to avoid copying too much of the dirent over
the user supplied buffer.  this can be a problem when the user doesn't
supply a full dirent and we corrupt their memory.
2002-02-26 21:39:32 +00:00
Maxim Sobolev
b73aa6457c Per POSIX <grp.h> doesn't require <sys/types.h>.
Submitted by:	ache
2002-02-25 17:20:40 +00:00
Warner Losh
576541a9e6 Fixed divots that I created when I moved prototypes of group_from_gid
and user_from_uid to grp.h and pwd.h.  Update the man pages.

Submitted by: David Malone
Pointy hat to: imp
2002-02-19 00:05:59 +00:00
Warner Losh
63195486ba Use new-style function declations. 2002-02-13 09:30:47 +00:00
Ruslan Ermilov
2ef702f52a FreeBSD 4.1 bootstrapping aid (__FBSDID is not there). 2002-02-08 09:34:17 +00:00
Maxim Sobolev
c6de4ce791 Allow ldd(1) be used on shared libraries in addition to executables. 2002-02-04 10:33:48 +00:00
Bruce Evans
49efc51214 Fixed tab lossage in vendor id and nearby style bugs in previous commit. 2002-02-01 23:26:32 +00:00
Bruce Evans
eb0a30f4c1 Fixed syntax error in previous commit. It was non-fatal because it was
in conditional code that happens not to be compiled, and because gcc
doesn't complain garbage after #endif by default.

Fixed some style bugs in previous commit, 1.8 and 1.1.
2002-02-01 23:16:39 +00:00
David E. O'Brien
60e104f3f5 Fixed slipage in editor. 2002-02-01 07:26:00 +00:00
David E. O'Brien
26a2df7351 Cut-n-paste in `list' mode considered harmful. 2002-02-01 07:25:07 +00:00
David E. O'Brien
b231cb3945 * Remove __P and convert to ANSI prototypes.
* Remove 'register'.  (some functions had 7+ register functions...)
* Fix SCM ID's.
2002-02-01 01:32:19 +00:00
David E. O'Brien
22626efa0f * Remove 'register'. (some functions had 7+ register functions...)
* Fix SCM ID's.
2002-02-01 01:08:48 +00:00
David E. O'Brien
ea8d448a92 Fix SCM ID's. 2002-02-01 00:57:29 +00:00
David E. O'Brien
ec4c2e3605 Fix minor style nit. 2002-01-31 17:26:37 +00:00
Bruce Evans
56bcbf00e2 Fixed world breakage due to missing include of <sys/cdefs.h> in previous
commit.

Fixed related style bugs:
basename.c: misplaced '#if 0'
dirname.c: misplaced '#if 0'
getgrent.c: missing '#if 0', and tab lossage in vendor id (the previous
            commit fixed the complete corruption of the vendor id but
	    lost a tab)
getpwent.c: missing '#if 0'
2002-01-31 12:58:36 +00:00
David E. O'Brien
135b57f906 Fix FreeBSD IDs. 2002-01-30 21:36:57 +00:00
David Malone
ab09ef008f Use ctime_r to build the timestamp for syslog, so that we don't
clobber a ctime buffer which is passed in.

PR:		34022
Submitted by:	Hartmut Brandt <brandt@fokus.gmd.de>
MFC after:	2 weeks
2002-01-25 21:49:34 +00:00
Ruslan Ermilov
0e65089b79 The sixth argument to the NET_RT_IFLIST sysctl is actually 0 for
all interfaces, and ifnet.if_index value for a single interface.
2002-01-23 12:48:08 +00:00
Mark Murray
5567b258eb Use the proper type (gid_t) for (group)->gr_gid to be orthogonal
with uid_t usage and (user)->pw_uid.

PR:		3242
2002-01-22 17:32:53 +00:00
Ruslan Ermilov
89ac4ecce1 mdoc(7) police: tidy up OpenBSD fixes. 2002-01-16 15:21:39 +00:00
Ruslan Ermilov
491a842962 yp(4) -> yp(8).
PR:		docs/30797
2002-01-14 16:59:03 +00:00
Crist J. Clark
971730fc67 Merge some updates and markup fixes from OpenBSD. This is mainly
motivated by the new "CAVEATS" section.

Inspired by:	alfred noting NetBSD's merging OpenBSD's changes
Obtained from:	OpenBSD
2002-01-14 02:08:02 +00:00
Daniel Eischen
aee4cebfe7 Include <stddef.h> to fix build problem when namespace pollution
by <signal.h> (including <time.h> so that NULL is accidentally defined)
is removed.

Style nits.

Submitted by:	bde
2002-01-11 19:46:08 +00:00
Bruce Evans
614acf2fad Fixed missing backslash in previous commit. 2002-01-11 16:08:49 +00:00
Bruce Evans
b944866c25 Fixed accumulated unsorting and some other style bugs (long lines). 2002-01-11 15:59:30 +00:00
Daniel Eischen
b66b8326e5 Add getcontext, setcontext, makecontext, and swapcontext. These
functions are defined in SUSv2 and the latest POSIX spec.

Thanks to Bernd Walter <ticso@cicely8.cicely.de> for helping debug my
alpha assembly.

Approved by:	-arch
2002-01-10 02:40:59 +00:00
Ruslan Ermilov
358034bcfe If the OID is missing, sysctl(3) returns ENOENT, not EOPNOTSUPP.
PR:		docs/32793
Submitted by:	Hartmut Brandt <brandt@fokus.gmd.de>
2001-12-13 10:59:00 +00:00
Ruslan Ermilov
edd2da71b2 Start using .St macro for POSIX.1-2001. 2001-12-08 19:06:23 +00:00
Dag-Erling Smørgrav
6478822fba Correct some egregious style bugs. 2001-12-04 12:32:35 +00:00
Dag-Erling Smørgrav
a8adfe18ce Add a missing error check. This fixes a bug that would cause pwd_mkdb to
dump core if invoked with an input file that looks like a password file
but isn't (e.g. /etc/group).

PR:		32378
Submitted by:	Maxim Konovalov <maxim@macomnet.ru>
MFC after:	1 week
2001-12-04 12:31:02 +00:00
Anton Berezin
b9449db117 Fix typos getpeerid -> getpeereid.
PR:		docs/32442
Reviewed by:	dd
2001-12-02 23:50:40 +00:00
Joseph Koshy
4d44f0b5a3 Add support for sysconf(_SC_NPROCESSORS_CONF) and sysconf(_SC_NPROCESSORS_ONLN).
This API is supported in SVR4.0MP, Solaris, Linux, AIX and Tru64 Unix.

PR:		bin/27489
Submitted by:	Arun Sharma <arun@sharma-home.net>
Reviewed by:	bde (prior version)
2001-12-01 12:07:42 +00:00
Anton Berezin
7d3346ca1f Do not write warning messages on stderr - a caller is expected to check
the return code and errno instead.  Those warnings did not do any good
for daemonized users of initgroups(3), and confused cvs clients that
communicated with non-root cvs pserver.

The committed fix differs from the one suggested in the PR, and was
submitted by ru.

PR:		15421
Approved by:	markm
Discussed on:	-stable, -current at various times
2001-11-28 10:55:02 +00:00
Ruslan Ermilov
88961d09b1 mdoc(7) police: markup cleanup. 2001-11-22 11:17:58 +00:00
Ruslan Ermilov
1f41435506 mdoc(7) police: add missing comma. 2001-11-22 09:48:54 +00:00
Max Khon
1e45081335 fix compilation (include -> #include) 2001-11-21 20:40:21 +00:00
Brian Feldman
70d2a9e100 Should also include namespace.h
Submitted by:	ru
2001-11-21 15:33:40 +00:00
Brian Feldman
a939ced805 Change certain syscalls from x to _x.
Prodded by:	bde
2001-11-21 14:44:52 +00:00
Brian Feldman
13d98e8c66 Introduce readpassphrase(3), a superset of getpass(3). This
comes originally from Todd Miller.

Obtained from:	OpenBSD
2001-11-20 15:15:42 +00:00
Ruslan Ermilov
d3eb181523 mdoc(7) police: remove whitespace at EOL. 2001-11-20 13:43:58 +00:00
Dima Dorfman
0157de9706 Create link from directory.3 to readdir_r.3.
PR:		32028
Submitted by:	andrew@ugh.net.au
2001-11-16 15:49:38 +00:00
Bruce Evans
ac8e56a7f9 Fixed namespace pollution related to `err' in libc in the same way as for
`warn'.  Now a whole 2 members of the err() family don't cause pollution.

This fixes world breakage in awk for NOSHARED worlds. contrib/awk/msg.c
has had its own version of err() for a long time, but this somehow
didn't cause problems until the update to awk-3.1.0.
2001-11-11 02:48:09 +00:00
David Malone
7e1b81799d Add a note explaining why CLOCKS_PER_SEC isn't 1000000.
While I'm here, "of a second" does not belong to CLOCKS_PER_SEC.

PR:		30297
Submitted by:	Bernd Luevelsmeyer <bdluevel@heitec.net>
2001-11-05 21:30:43 +00:00
Poul-Henning Kamp
b4e471b90f Add notice about early use from malloc.c forbidding malloc use from
this function.
2001-11-02 11:30:42 +00:00
Mike Barcroft
762e881bab Make the output from assert() look more like the example in the C99
standard.

Requested by:	bde
2001-10-29 07:07:25 +00:00
Mike Barcroft
cb5f460523 Only provide function information in compile environments that support
the C99 variable __func__ and never for C++.  Provide a more meaningful
example in the assert(3) manual.

Reviewed by:	asmodai, bde
2001-10-27 20:11:10 +00:00
Mike Barcroft
c44a27673c Restore K&R prototype. Fix other style bugs.
Reviewed by:	asmodai, bde
2001-10-27 19:37:20 +00:00
Peter Wemm
9213df7cda Explicitly use int32_t for on-disk records for pw_change and pw_expire,
since that is what we use now and this insulates us from any time_t
tweaks here.  We can define a record format that uses 64 bit times if/when
we need to.
2001-10-27 02:13:41 +00:00
Jeroen Ruigrok van der Werven
6cefb54a32 Add __FBSDID.
Change __assert() function to print failing function name.
#if 0 the sccsid block.
This makes us C99 conforming.
2001-10-24 18:12:18 +00:00
Bruce Evans
6eabd84580 Compensate for "Compensate for header dethreading" by backing it out. 2001-10-10 17:48:44 +00:00
Ruslan Ermilov
32eef9aeb1 mdoc(7) police: Use the new .In macro for #include statements. 2001-10-01 16:09:29 +00:00
Ruslan Ermilov
7d8983a292 Document the FTS_ROOTPARENTLEVEL and FTS_ROOTLEVEL constants. 2001-09-20 12:32:45 +00:00
Ruslan Ermilov
d6002fef6f Use ``.Rv -std'' wherever possible.
Submitted by:	yar
2001-08-31 09:57:38 +00:00
Bruce Evans
1643f03d5f Fixed namespace pollution related to `warn' in libc (but not in other
libraries or for other members of the err() family).

This fixes world breakage in bc and rcs/* for NOSHARED worlds.
2001-08-29 13:52:27 +00:00
Dima Dorfman
dae32f31ab begin executed --> being executed
Obtained from:	NetBSD
2001-08-24 00:18:37 +00:00
Dima Dorfman
2c0dd4d134 Use .In, .Ux, and .Rv where appropriate. Also consistently call this
a "function" instead of a "routine".

Submitted by:	ru
2001-08-21 19:32:47 +00:00
Dima Dorfman
ccbe835258 Expand the ?: construct into an if/else.
Submitted by:	nectar
2001-08-21 19:27:07 +00:00
Dima Dorfman
c9fa8f40fe The setprogname() function sets the name of the program to be the last
component of the progname argument.
2001-08-21 18:49:58 +00:00
Dima Dorfman
f7bec57b78 Fix style bug. 2001-08-21 18:46:33 +00:00
Ruslan Ermilov
c45f3b47c8 Fixed warnings. 2001-08-21 17:28:39 +00:00
Jacques Vidrine
80578ef3c9 Pass the pointy hat, please.
Submitted by:	ru
2001-08-21 17:16:32 +00:00
Jacques Vidrine
dbdb228cf7 setprogname() should set __progname to the last component of the given
path.
2001-08-21 16:55:34 +00:00
Dima Dorfman
e6063dd1a6 Implement getpeereid(3), a front-end to the LOCAL_PEERCRED
socket option for the Unix domain.  It's weaker than the
socket option (this only returns the uid and gid, while the
socket opt. can return the entire group list), and is
implemented mostly for compatibility with OpenBSD.
2001-08-17 22:09:15 +00:00
Yaroslav Tykhiy
a2a0a4dc2a Use the ".Rv" mdoc(7) macro where appropriate.
Reviewed by:	ru
2001-08-14 14:20:35 +00:00
Ruslan Ermilov
753d686d34 mdoc(7) police: s/BSD/.Bx/ where appropriate. 2001-08-14 10:01:54 +00:00
Ruslan Ermilov
ed2879a5cf mdoc(7) police: s;BSD/OS;.Bsx; where appropriate. 2001-08-13 17:07:40 +00:00
Ruslan Ermilov
d013e3f544 mdoc(7) police: s/NetBSD/.Nx/ where appropriate. 2001-08-13 17:00:36 +00:00
Ruslan Ermilov
c5e7e03a14 Spell "FreeBSD" with "F" and "BSD" in uppercase. 2001-08-13 16:33:00 +00:00
Ruslan Ermilov
8af1452cf8 Removed duplicate VCS ID tags, as per style(9). 2001-08-13 14:06:34 +00:00
Ruslan Ermilov
94ba280c59 mdoc(7) police: join split punctuation to macro calls. 2001-08-10 17:35:21 +00:00
Ruslan Ermilov
c75526d5a0 mdoc(7) police: fixed the "new sentence" bogons. 2001-08-10 15:03:10 +00:00
Ruslan Ermilov
57e4378bf6 mdoc(7) police: protect trailing full stops of abbreviations
with a trailing zero-width space: `e.g.\&'.
2001-08-10 13:45:36 +00:00
Maxim Sobolev
5d25d75662 Fix xrefs.
times.3:	gettimeofday(3) --> gettimeofday(2)
rc.conf.5:	isndn(8)	--> isdnd(8)
		idsnd(8)	--> isdnd(8)

MFC after:	2 weeks
2001-08-09 15:46:53 +00:00
Yaroslav Tykhiy
b1250632c5 Use the ``.Rv -std'' mdoc(7) macro in appropriate cases.
Reviewed by:	ru
2001-08-09 13:32:13 +00:00
Mike Heffner
785ead5062 typo: patched->matched 2001-08-09 00:34:57 +00:00
Ruslan Ermilov
6575e6daae mdoc(7) police: expand plain text xrefs. 2001-08-08 11:48:28 +00:00
Ruslan Ermilov
c4d9468ea0 mdoc(7) police:
Avoid using parenthesis enclosure macros (.Pq and .Po/.Pc) with plain text.
Not only this slows down the mdoc(7) processing significantly, but it also
has an undesired (in this case) effect of disabling hyphenation within the
entire enclosed block.
2001-08-07 15:48:51 +00:00
Ruslan Ermilov
f61004566c mdoc(7) police: markup nits. 2001-08-07 12:17:32 +00:00
Dima Dorfman
557b792532 varargs -> stdarg 2001-08-05 05:39:16 +00:00
Sheldon Hearn
86f478757a MFS: in HISTORY section, fix release number of first appearance 2001-08-01 12:15:21 +00:00
Sheldon Hearn
b47d4cf924 Fix broken Fn calls; Fn doesn't take a manual page section as an
argument.

Terminate the last sentence with a period.
2001-08-01 12:04:32 +00:00
Mark Peek
545d32087b Only pull in the MD files if they exist. This allows for progressive
implementation and compilation when bringing up a new architecture.
2001-07-31 16:34:52 +00:00
Jeroen Ruigrok van der Werven
6a0fc191fb FreeBSD now also defines EIDRM and uses it.
Inspired by PR:		22470
Which was submitted by:	Bjorn Tornqvist <bjorn@west.se>
MFC after:	1 week
2001-07-30 19:30:26 +00:00
Jeroen Ruigrok van der Werven
2341e86854 Remove bogus BUGS section.
FreeBSD _does_ define ENOMSG as per SVID when IPC_NOWAIT is set.

PR:		22470
Submitted by:	Bjorn Tornqvist <bjorn@west.se>
MFC after:	1 week
2001-07-30 19:25:16 +00:00
Thomas Moestl
d35bce02ee Correct the old length argument passed to sysctlbyname to be a pointer
to a size_t (not to an int).

MFC after:	2 days
2001-07-29 22:01:55 +00:00
Mike Heffner
75dc5f1a82 Rename the GLOB_MAXPATH flag of glob(3) to GLOB_LIMIT to be compatible
with NetBSD and OpenBSD. glob(3) will now return GLOB_NOSPACE with
errno set to 0 instead of GLOB_LIMIT when we match more than `gl_matchc'
patterns. GLOB_MAXPATH has been left as an alias of GLOB_LIMIT to
maintain backwards compatibility.

Reviewed by:	sheldonh, assar
Obtained from:	NetBSD/OpenBSD
2001-07-29 00:52:37 +00:00
Sheldon Hearn
745b20f712 The previous delta duplicated a significant amount of information
already found in the sigaction(2) manual.

As discussed with the committer of that delta, cross-reference the list
in sigaction(2) instead of duplicating the list of functions that are
safe for use within signal handlers.
2001-07-24 11:37:33 +00:00
Kris Kennaway
fd9139a04e Add the list of signal-handler safe functions here too, so people can
find it more easily

Obtained from:	OpenBSD
MFC After:	1 week
2001-07-24 08:26:37 +00:00
Ruslan Ermilov
97e1bac189 mdoc(7) police: fix markup. 2001-07-18 15:55:34 +00:00
Kris Kennaway
54b8fe08cf Remove unnecessary #include <stdlib.h>
Obtained from:	NetBSD
MFC After:	1 week
2001-07-16 04:48:28 +00:00
Dima Dorfman
7ebcc426ef Remove whitespace at EOL. 2001-07-15 07:53:42 +00:00
Ruslan Ermilov
a307d59838 mdoc(7) police: removed HISTORY info from the .Os call. 2001-07-10 13:41:46 +00:00
David E. O'Brien
8dfd7bcddf MFS: add the FreeBSD history. 2001-07-10 00:12:50 +00:00
David E. O'Brien
6e6c8a08c8 Give the FreeBSD history also. 2001-07-10 00:11:00 +00:00
Dima Dorfman
70d51341bf mdoc(7) police: remove extraneous .Pp before and/or after .Sh. 2001-07-09 09:54:33 +00:00
Ruslan Ermilov
3d1455a39d mdoc(7) police: compact VFCF_ list. 2001-07-04 10:42:03 +00:00
Dima Dorfman
f9eeb822d0 mdoc(7) police: fix spacing issue
Submitted by:	ru
2001-07-03 21:16:34 +00:00
Dima Dorfman
ff5f0dbc41 Fix a one-byte overrun.
PR:		28472
Submitted by:	David Xu <davidx@viasoft.com.cn>
Obtained from:	OpenBSD
2001-06-28 21:50:53 +00:00
Dima Dorfman
9351f51fd8 getcwd(3) is defined by POSIX, not ISO C.
Approved by:	bde
2001-06-28 19:27:02 +00:00
Dima Dorfman
9a66daa5d4 Document the existing vfc_flags.
PR:		25837
Submitted by:	Tony Finch <dot@dotat.at>
2001-06-28 06:50:19 +00:00
Dima Dorfman
a910f192bb Remove duplicate words. 2001-06-24 01:34:38 +00:00
Dima Dorfman
12985df355 Fix a grammar bogon. 2001-06-20 22:03:10 +00:00
Garrett Wollman
3f22a03fa6 Fix spelling of `errno' and add cross-references. 2001-06-18 22:26:31 +00:00
Garrett Wollman
5813675eed Document _SC_IOV_MAX. Add cross-references to pathconf(2), confstr(3), and
getconf(1).  This document still needs to be sorted and to have other missing
parameters described.
2001-06-18 22:18:08 +00:00
Garrett Wollman
37336173d3 After one too many PRs on the subject, bite the bullet and define IOV_MAX
and its associated constants.  Implement _SC_IOV_MAX in the usual way.
Be a bit sloppy about the namespace question; this should get cleared up
in time for 5.0.

MFC after:	1 month
2001-06-18 20:24:54 +00:00
David Malone
75328eca8d If the username we are trying to look up in the db files won't fit into
the buffer then act like it doesn't exist. The buffer is always big enough
for any valid username.

PR:		27860
Reviewed by:	nectar
2001-06-18 16:09:24 +00:00
Ruslan Ermilov
589ee357a4 Complete prototype for fts_compar. 2001-06-13 14:59:57 +00:00
Ian Dowse
f9f6897972 Make the non-threaded stub for pthread_sigmask() a no-op instead
of calling sigprocmask(). This matches the behaviour of thr_sigsetmask()
on Solaris; _pthread_sigmask_stub was added purely for compatibility
with Solaris (for TI-RPC), so it might as well do the same thing.

This fixes the problem where client RPC calls ignored all signals
for the complete duration of the RPC. This behaviour is currently
necessary in the threaded case due to locking issues, but was never
intended to occur in non-threaded programs.

Reviewed by:	deischen
2001-06-11 23:18:22 +00:00
Dima Dorfman
4088069c3a Xref dladdr(3).
Requested by:	-hackers
2001-06-08 22:50:33 +00:00
Kris Kennaway
93a8551831 Fix another unprotected instance of chdir() by extending the
fts_safe_changedir() function and using that instead for both of the
chdir()s.

Partially submitted by:	Todd Miller <millert@OpenBSD.org>, bde
2001-06-01 21:53:50 +00:00
Kris Kennaway
fdeb0156dd When doing the chdir("..") in the !FTS_NOCHDIR case, stat() after we get
there and compare the inode and device numbers to the values we remember,
to guard against the directory having been moved around in the meantime.

Reported by:	Nick Cleaton <nick@cleaton.net>
2001-05-30 20:35:44 +00:00
Eric Melville
2de2196026 Add warnings about trusting user-supplied data.
Reviewed by:	ru
Approved by:	murray
Obtained from:	OpenBSD
2001-05-25 20:42:40 +00:00
Ruslan Ermilov
d4aac95ca2 Fix the range of the returned value.
PR:		docs/27446
Submitted by:	Tadayuki OKADA <tadayuki@mediaone.net>
2001-05-23 12:37:50 +00:00
Ruslan Ermilov
58ceb60878 Suppress compiler warning by adding a type cast. 2001-05-17 12:51:43 +00:00
Dima Dorfman
cd18ccdc30 Introduce getprogname(3) and setprogname(3) library calls. These get
and set __progname, respectively.

Discussed on:	-arch (Feb 2001), -audit
Reviewed by:	-audit
Approved by:	kris
Obtained from:	(mostly) NetBSD
2001-05-15 23:41:01 +00:00
David E. O'Brien
5e6220d9d0 * include/elf.h has been repo copied to include/elf-hints.h, and it no
longer includes machine/elf.h.
* consumers of elf.h now use the minimalist elf header possible.

This change is motivated by Binutils 2.11.0 and too much clashing over
our base elf headers and the Binutils elf headers.
2001-05-02 23:56:21 +00:00
Mark Murray
e16138fead Compensate for header dethreading. 2001-05-01 09:30:02 +00:00
Joerg Wunsch
b2bcd87e4f Fix directory reads of MNT_UNION mounts, where entries present in both
layers would be displayed twice.

PR:		bin/26498
Submitted by:	Olliver Fromme <olli@secnetix.de>
2001-04-23 10:01:38 +00:00
Ruslan Ermilov
eb0838029f mdoc(7) police: normalize .Nd. 2001-04-18 15:54:10 +00:00
Ruslan Ermilov
2efb80a813 mdoc(7) police: fix markup. 2001-04-18 15:43:06 +00:00
Kris Kennaway
3d09054934 Add fmtcheck(), a function for checking consistency of format string
arguments where the format string is obtained from user data, or
otherwise difficult to verify statically.

Example usage:

printf(fmtcheck(user_format, standard_format), arg1, arg2);

checks the format string user_format for consistency (same number/order/
type of format operators) with standard_format.  If they differ,
standard_format is used instead to avoid potential crashes or security
violations.

Obtained from:  NetBSD
Reviewed by:    -arch
2001-04-17 07:59:52 +00:00
Daniel Eischen
54fd7f685f To be consistent, use the __weak_reference macro from <sys/cdefs.h>
instead of #pragma weak to create weak definitions.  This macro is
improperly named, though, since a weak definition is not the same
thing as a weak reference.

Suggested by:	bde
2001-04-10 04:11:50 +00:00
Ruslan Ermilov
6a5e9ec940 mdoc(7) police: add missing .Pa call. 2001-04-04 09:52:28 +00:00
Peter Wemm
487dbd927f Mostly pick up OpenBSD's rev 1.14 by deraadt@ and millert@.
I've left out a couple of unused args between internal functions.
Use MAXPATHLEN, not MAXPATHLEN + 1 in a couple of places.
Pass a pointer to the end of the target filename space.
2001-03-28 23:55:51 +00:00
Peter Wemm
27d52f6943 OpenBSD's g_Ctoc() returned a false error when the target buffer was
exactly the right size.  Do it differently - pass a length rather than an
end-of-string+1 pointer as this is more convenient anyway.  Get rid of
the bogus +1's.
2001-03-28 10:56:11 +00:00
Peter Wemm
76e2bc010d Fix g_Ctoc() interface, approximately based on OpenBSD's recent changes.
Also, set gl_pathv to NULL after we free it, especially when dealing
with realloc failures.

Obtained from: OpenBSD
2001-03-28 09:53:16 +00:00
Chris Timmons
5c620e2dad Document LOG_CONSOLE. 2001-03-27 19:55:53 +00:00
Ruslan Ermilov
4a558355e5 MAN[1-9] -> MAN. 2001-03-27 17:27:19 +00:00
Alfred Perlstein
8f15078110 give the "netgrent" functions a home in netdb.h 2001-03-27 09:49:03 +00:00
Peter Wemm
32e479705a This is kind of a hack, but it should work. Currently, world is broken
because libc/rpc/key_call.c references uname(), and ps/print.c also
defines uname(), and ps is linked statically.  This leads to a symbol
clash.  The userland uname(3) kinda sucked anyway as the hostname
etc was too short.  And since the libc rpc interface now uses
the utsname.nodename which gets truncated, I was tempted into doing
something about it.  Create a new userland uname function, called
__xuname() which takes an extra argument that allows you to change
the size of the fields.  uname() becomes a static inline function
in sys/utsname.h that passes the extra argument in.  struct utsname
has its field members expanded by default now in userland.
We still provide a 'uname' externally linkable function for things
that either think that they ``know'' the utsname format and assume
32 character strings and bypass the include file, or objects that
are linked against old libcs.  ie: just about every plausible
case that I can think of is covered.  Should we ever change the
default lengths again, a libc major bump should not be required
as the size is now passed to the function.

XXX the uname(2) in the kernel is for FreeBSD 1.1 binary compatability!
All the uname(3) functions that are exported to userland are actually
implemented in libc with sysctl.  uname(1) uses sysctl directly and
does not call uname(3).

PR:		bin/4688
2001-03-24 04:40:49 +00:00
Jonathan Lemon
bae8632f82 Introduce the GLOB_MAXPATH flag, which allows the user to limit the
number of paths which glob(3) will return.  Remove the hardcoded limit
from the last commit, which restores the previous unbounded behavior.

Document the new flag in the manual page.
2001-03-19 19:10:06 +00:00
Alfred Perlstein
8360efbd6c Bring in a hybrid of SunSoft's transport-independent RPC (TI-RPC) and
associated changes that had to happen to make this possible as well as
bugs fixed along the way.

  Bring in required TLI library routines to support this.

  Since we don't support TLI we've essentially copied what NetBSD
  has done, adding a thin layer to emulate direct the TLI calls
  into BSD socket calls.

  This is mostly from Sun's tirpc release that was made in 1994,
  however some fixes were backported from the 1999 release (supposedly
  only made available after this porting effort was underway).

  The submitter has agreed to continue on and bring us up to the
  1999 release.

  Several key features are introduced with this update:
    Client calls are thread safe. (1999 code has server side thread
    safe)
    Updated, a more modern interface.

  Many userland updates were done to bring the code up to par with
  the recent RPC API.

  There is an update to the pthreads library, a function
  pthread_main_np() was added to emulate a function of Sun's threads
  library.

  While we're at it, bring in NetBSD's lockd, it's been far too
  long of a wait.

  New rpcbind(8) replaces portmap(8) (supporting communication over
  an authenticated Unix-domain socket, and by default only allowing
  set and unset requests over that channel). It's much more secure
  than the old portmapper.

  Umount(8), mountd(8), mount_nfs(8), nfsd(8) have also been upgraded
  to support TI-RPC and to support IPV6.

  Umount(8) is also fixed to unmount pathnames longer than 80 chars,
  which are currently truncated by the Kernel statfs structure.

Submitted by: Martin Blapp <mb@imp.ch>
Manpage review: ru
Secure RPC implemented by: wpaul
2001-03-19 12:50:13 +00:00
Jonathan Lemon
daa4742e72 Bump MAX_GLOBENTRIES up to 16384, so it is a power of two. Add
some comments explaining that this is an arbitrary limit.

Requested by:  jkh
2001-03-16 19:05:20 +00:00
Jonathan Lemon
813c96dbd7 Limit the number of paths that glob can return to MAX_GLOBENTRIES, which
is currently set to 10000.  This is intended to prevent glob from running
amok when a highly recursive path is provided (such as "../*/../*/../*/...")

Reviewed by: Diane Bruce <db@db.net>, jhb
2001-03-15 18:50:32 +00:00
Brian Somers
ad5a84f5eb Mention that MAXHOSTNAMELEN includes space for the NUL. 2001-03-15 08:35:53 +00:00
David Malone
aa9ab917d7 Use the right format string for printing ULONG_MAX. 2001-03-05 11:58:12 +00:00
David E. O'Brien
d2357f9842 Fix style breakage in rev 1.3 2001-03-05 09:33:08 +00:00
David E. O'Brien
8bb47e4083 Fix style bug that was introduced. 2001-03-05 09:21:44 +00:00
Ruslan Ermilov
fdc1fef594 Use ``.St -p1003.[12]''. 2001-02-26 16:12:39 +00:00
Ruslan Ermilov
096841eceb Use ``.St -p1003.1-96''. 2001-02-26 15:16:43 +00:00
Ruslan Ermilov
3d751065b0 `.St -p1003.1b'' -> `.St -p1003.1b-93''. 2001-02-26 14:33:54 +00:00
Ruslan Ermilov
588a200ce1 .St -ansiC -> .St -isoC 2001-02-26 13:23:47 +00:00
Ruslan Ermilov
52017970cb mdoc(7) police: use .Vt macro. 2001-02-26 09:15:17 +00:00
Ruslan Ermilov
bcdf5ca7c6 Prepare for mdocNG. 2001-02-26 09:05:48 +00:00
Jeroen Ruigrok van der Werven
7c63796828 Preceed/preceeding are not english words. Use precede or preceding. 2001-02-18 10:25:42 +00:00
Daniel Eischen
29ac6bd228 libc MT-safety, part 2.
Add a lock to FILE.  flockfile and friends are now implemented
(for the most part) in libc.  flockfile_debug is implemented in
libc_r; I suppose it's about time to kill it but will do it in
a future commit.

Fix a potential deadlock in _fwalk in a threaded environment.
A file flag (__SIGN) was added to stdio.h that, when set, tells
_fwalk to ignore it in its walk.  This seemed to be needed in
refill.c because each file needs to be locked when flushing.

Add a stub for pthread_self in libc.  This is needed by flockfile
which is allowed by POSIX to be recursive.

Make fgetpos() error return value (-1) match man page.

Remove recursive calls to locked functions (stdio); I think I've
got them all, but I may have missed a couple.

A few K&R -> ANSI conversions along with removal of a few instances
of "register".

$Id$ -> $FreeBSD$ in libc/stdio/rget.c

Not objected to:	-arch, a few months ago
2001-02-11 22:06:43 +00:00
Ruslan Ermilov
46eea498da mdoc(7) police: Change -filled displays (which just happen
to be the same as -ragged in the current implementation) to
-ragged.  With mdocNG, -filled displays produce the correct
output, formatted and justified to both margins.
2001-02-07 13:45:30 +00:00
Bruce Evans
60babc5565 Don't install links for crypt.3 here. There is no crypt.3 here...
Forgotten in:	rev.1.58, which was not Submitted by: bde (I requested
                untangling parts of the crypto mess).
2001-02-05 14:55:14 +00:00