Commit Graph

4875 Commits

Author SHA1 Message Date
dd
8c783a5ee3 Don't pass NULL to the %s format.
Reviewed by:	kris
2001-04-22 03:00:09 +00:00
msmith
6bd88c935a Turn on libdevinfo 2001-04-21 00:11:00 +00:00
msmith
cf417cc2be devinfo_var.h should not be in INCS 2001-04-20 23:10:09 +00:00
msmith
35db50d909 More typo fixes, .Os -> .Fx 2001-04-20 23:02:52 +00:00
msmith
be1ff48065 typo .Fr -> .Fn 2001-04-20 23:00:24 +00:00
msmith
7365c5d43a Add a manpage for libdevinfo. 2001-04-20 22:48:12 +00:00
msmith
4a5aacdfea This is the Device Information Library, libdevinfo.
The devinfo library provides access to the kernel's internal device
hierarchy and to the I/O resource manager.  The library uses a
sysctl(9) interface to obtain a snapshot of the kernel's state which
is then made available to the application.
2001-04-20 05:53:30 +00:00
ru
4e6c415ba3 mdoc(7) police: update referenced standard name. 2001-04-18 16:01:43 +00:00
ru
1db489053b mdoc(7) police: normalize .Nd. 2001-04-18 15:54:10 +00:00
ru
be6521fa6f mdoc(7) police: fix markup. 2001-04-18 15:43:06 +00:00
ru
4358edc9a5 mdoc(7) police: fix markup. 2001-04-18 13:16:47 +00:00
ru
636c7bc21c mdoc(7) police: use .Fx where appropriate. 2001-04-18 13:14:47 +00:00
deischen
0895401012 Typo; fix open() so that it is not a cancellation point when called
from libc.
2001-04-18 12:42:11 +00:00
deischen
9147539de5 Reinstall the alternate signal stack after a fork.
PR:		25110
Tested by:	knu
2001-04-18 12:40:30 +00:00
ru
aff1cfdd86 mdoc(7) police: uppercase document title. 2001-04-18 08:25:26 +00:00
kris
5ac9e3403b Correct a typo; prefered -> preferred. 2001-04-17 08:01:54 +00:00
kris
f345315f0c 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
ru
2cdab6727d mdoc(7) police: add missing .El call. 2001-04-16 15:06:57 +00:00
ru
522adcae57 mdoc(7) police: fix markup. 2001-04-16 15:06:19 +00:00
dd
746d677de3 Grammar police: "its", not "it's", is the possessive form of "it". 2001-04-15 19:53:47 +00:00
dd
4c030307a9 Make links from setresuid.2 to getresgid.2 and getresuid.2. 2001-04-15 19:41:44 +00:00
dd
4d7d3e4b03 Document getresgid and getresuid calls.
Reviewed by:	ru
2001-04-15 19:40:22 +00:00
jedgar
6328307bd9 Correct a bogus cast in acl_get_qualifier() causing invalid
ID's to be stored in the ACL.

Obtained from:	TrustedBSD Project
2001-04-15 15:21:15 +00:00
dd
5b4154d414 Add `RETURN VALUES'' and `ERRORS'' sections since getpgid(2) can
fail.  Also fix a minor grammar nit (it's -> its).

PR:		26520
2001-04-14 02:34:59 +00:00
jedgar
9fe4ef0a1b Add acl_get_perm_np(3), a non-portable function to check if a
permission is in a permission set, required for third-party
applications such as Samba.

Reviewed by:	rwatson
Obtained from:	TrustedBSD Project
2001-04-13 19:37:04 +00:00
jedgar
ed203c2e6d Add the remaining POSIX.1e ACL definitions:
ACL_UNDEFINED_TAG, ACL_UNDEFINED_ID, ACL_FIRST_ENTRY, ACL_NEXT_ENTRY

Reviewed by:	rwatson
Obtained from:	TrustedBSD Project
2001-04-13 19:14:38 +00:00
ache
b987d927b6 Back out history.3 link removing - conflict fixed in libreadline instead 2001-04-12 09:57:12 +00:00
ache
5345e3268d Comment out one of many editline.3 MLINKS conflicting with libreadline
(history.3)
2001-04-12 03:33:13 +00:00
jedgar
d6a3c4961b Revamp acl_create_entry() so it actually works.
Obtained from:	TrustedBSD Project
2001-04-11 22:09:51 +00:00
jedgar
d900d9995a Correct the following defines to match the POSIX.1e spec:
ACL_PERM_EXEC  -> ACL_EXECUTE
  ACL_PERM_READ  -> ACL_READ
  ACL_PERM_WRITE -> ACL_WRITE

Obtained from:	TrustedBSD
2001-04-11 02:19:01 +00:00
deischen
4298f6b4f8 Clean up a bit. Use the correct TAILQ link when walking the thread
lists to free thread resources after a fork (in the child).  Also
remember to free the dead thread list.
2001-04-10 04:25:49 +00:00
deischen
a32712acca Added a missing set of braces to a conditional that encompasses more than
one statement.
2001-04-10 04:22:24 +00:00
deischen
64a87c91c4 To be consistent, use the __weak_reference macro from <sys/cdefs.h>
instead of #pragma weak to create weak definitions.

Suggested by:	bde
2001-04-10 04:19:21 +00:00
deischen
e9d09589c6 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
deischen
ce3a88f857 Include <unistd.h> so that read(2) and write(2) don't cause warnings. 2001-04-10 03:55:19 +00:00
deischen
ad5d48b6c1 Fix a comment within a comment warning due to a missing "*/". 2001-04-10 03:47:40 +00:00
iedowse
dd21c89847 The maximum RPC message size was set at 8k for UDP. This is lower
than the default buffer size in the old RPC code (8800 bytes), and
it could not be overriden by the application. This caused problems
with CFS (/usr/port/security/cfs).

Change this default back to UDPMSGSIZE (8800 bytes), but more
importantly, allow applications to use larger message sizes for
all protocols if desired. Choose an arbitrary maximum message size
of 256k instead of using the default as the maximum (which is
silly).

Reported by:	ache
Reviewed by:	alfred, Martin Blapp <mb@imp.ch>
2001-04-08 19:21:50 +00:00
dd
61e6ae75ac Mention that locks are inherited across an exec.
PR:		24802
Submitted by:	Kenneth Ingham <ingham@i-pi.com>
2001-04-08 19:11:25 +00:00
dd
0e6ae403b1 Install links to extattr_(get|set|delete)_fd.2 (from extattr_get_file.2). 2001-04-08 06:58:48 +00:00
gallatin
1487c156cb fix cd9660 to work on files larger than ISO_DEFAULT_BLOCK_SIZE and unbreak
cdboot on alphas (which has been broken since just after 4.0-RELEASE)

submitted by: jlemon
2001-04-07 23:48:46 +00:00
des
0e80555162 If the server's reply to the SIZE command is unparseable, reset us->size
to -1 so the caller will know it's invalid.  This is an MFC candidate.
2001-04-07 15:26:31 +00:00
ume
971d1eebf3 IPv6 support for skeyaccess(3). You can specify IPv6 address
using `internet' keyword into /etc/skey.access.

Not Objected to by:	-audit and -net
2001-04-05 19:56:54 +00:00
ru
bfd5bc7007 mdoc(7) police: add missing LIBRARY section. 2001-04-05 07:51:48 +00:00
ru
45dea262e7 Unbreak world.
Submitted by:	jhay
2001-04-05 07:47:06 +00:00
ru
31c520cca6 Record -lposix1e merge with -lc. 2001-04-05 07:42:56 +00:00
ru
0c22f5463f mdoc(7) police rev 1.11: convert descriptions and cross-references
for the ACL editing library functions to the plain tagged list.
2001-04-05 07:35:59 +00:00
jedgar
09266fdea1 - Add descriptions and cross-references for the ACL editing library
functions.
- Place the acl_dup() description in alphabetical order.
- Move the POSIX.1e descriptions under the ENVIRONMENT section to the
  STANDARDS section.

Reviewed by:	rwatson
Obtained from:	TrustedBSD Project
2001-04-05 01:48:07 +00:00
jedgar
26e5fd82b4 Install the acl_create_entry.3 man page 2001-04-05 01:36:54 +00:00
dd
9c39633d96 Document the extattr_(get|set|delete)_fd calls, and add a note warning
people that these calls are likely to change in the future.

Reviewed by:	rwatson
2001-04-05 01:24:05 +00:00
tmm
eb26d46fdf Remove the libposix1e, since it has been repo copied to libc/posix1e and
integrated into libc.

Approved by:	rwatson
Obtained from:	TrustedBSD Project
2001-04-04 18:29:03 +00:00
tmm
0ab05be9ca Activate build of posix1e extensions in libc and libc_r that have been
moved in from libposix1e, and deactivate build of the soon-to-be-removed
libposix1e.

Approved by:	rwatson
Obtained from:	TrustedBSD Project
2001-04-04 18:17:28 +00:00
tmm
144c74b449 Add thread safety wrappers for the posix1e syscalls that deal with file
descriptors.

Approved by:	rwatson
Obtained from:	TrustedBSD Project
2001-04-04 18:10:25 +00:00
tmm
8cd05f5bd3 Add entries for the posix1e functions that will be overridden in libc_r.
Approved by:	rwatson
Obtained from:	TrustedBSD Project
2001-04-04 18:04:10 +00:00
tmm
65e2d5e404 Prepare for the inclusion of libposix1e into libc: retire the old
Makefile, add Makefile.inc needed for libc build; add
#include "namespace.h"/#include "un-namespace.h" pairs around the
includes of sys/acl.h and sys/capability.h, and an additional underscore
in front of the functions that will be overridden in libc_r.

Approved by:	rwatson
Obtained from:	TrustedBSD Project
2001-04-04 18:00:52 +00:00
ru
4b0a48252c mdoc(7) police: use proper markup for function arguments. 2001-04-04 10:23:27 +00:00
ru
907938dcb8 mdoc(7) police: add missing .Pa call. 2001-04-04 09:52:28 +00:00
iedowse
48c7c65531 Fix some very broken code in __nc_error() that implements per-thread
`nc_error' variables. Move the nc_lock mutex from mt_misc.c to a
static variable within this function, since it is only used here.

Add a new getnetconfigent() error code `NC_NOTFOUND' to report the
case where the specified netid was not found. Set nc_error in all
error cases in getnetconfigent() so that the error messages returned
by nc_(s)perror are always meaningful.

Add a terminating \n to the output of nc_perror() to match both
our manpage and other implementations of this function.

Reviewed by:	deischen, alfred, Martin Blapp <mb@imp.ch>
2001-04-03 23:48:28 +00:00
iedowse
368005df8f Add a leading underscore to the pthread_main_np function name, and
a "#pragma weak" directive linking the external symbol. This matches
the other pthread_* definitions, and ensures that users of this
function from within libc get the real version, not the stub.

Suggested by:	deischen
Reviewed by:	deischen, alfred
2001-04-03 22:25:39 +00:00
iedowse
ec56b1c72a Remove some hacks that were apparently added to avoid problems with
RPC clients hanging. The real problem turned out to be missing
cleanup code; this was fixed in clnt_vc.c r1.5 and clnt_dg.c r1.4.

Submitted by:	Martin Blapp <mb@imp.ch>
2001-04-03 22:07:19 +00:00
bde
f2c531935b Fixed world breakage in previous commit (config.h was inaccessible
except in the unusual case where ${.OBJDIR} == ${.CURDIR}).

Fixed nearby style bugs (the DEFS variable had rotted to be just
an obfuscation).
2001-04-03 10:08:51 +00:00
fenner
af7a1c5b10 Update for libpcap 0.6.2 2001-04-03 04:34:50 +00:00
iedowse
20913b4072 There were a few error cases where the RPC code would return with
all signals masked (whoops). Add the missing cleanup code.

Reviewed by:	Martin Blapp <mb@imp.ch>, alfred
2001-04-02 22:14:13 +00:00
iedowse
66da8c4067 Move the #includes of reentrant.h to after the `#include "namespace.h"',
so that the underscored versions of the pthread functions get
declared.  This removes around 300 lines of 'implicit declaration
of XXX' warnings from the output of a libc build with -Wall.

Reviewed by:	Martin Blapp <mb@imp.ch>, alfred
2001-04-02 21:41:44 +00:00
dd
e12069278b Hook the extattr_get_file.2 manual page into the build. Add MLINKS
for extattr_set_file.2 and extattr_delete_file.2.
2001-04-01 23:46:56 +00:00
dd
15f845bd3a A manual page for the extattr_get_file, extattr_set_file, and
extattr_delete_file system calls.

Reviewed by:	rwatson, ru
Approved by:	nik
2001-04-01 23:45:11 +00:00
obrien
3e84dc487a Add spaces around operators.
It's OK, the Project and afford them now -- they aren't as expensive as
they used to be.
2001-04-01 12:18:20 +00:00
obrien
668eb11b4a Correct a comment. 2001-04-01 11:44:12 +00:00
obrien
670656b0a0 Try to untangle some of the #ifdef spaghetti.
Also, looking to the future, don't assume all the world is an i386 and all
its disk layout brain damage will be repeated by other platforms.  So all
the diking out if we are an Alpha, becomes adding in if we are an i386.
2001-04-01 11:37:31 +00:00
obrien
ff2bda84d1 Add back <err.h> for warn().
(of course it's pretty stupid to call it, as printf doesn't work w/in
sysinstall, and sysinstall is the only consumer of libdisk)
2001-04-01 11:32:56 +00:00
obrien
b01c4995c4 Quiet warnings on the Alpha. 2001-04-01 11:22:40 +00:00
obrien
77b6a0671d Add back <err.h> for warn().
(of course it's pretty stupid to call it, as printf doesn't work w/in
sysinstall, and sysinstall is the only consumer of libdisk)
2001-04-01 10:44:52 +00:00
ru
5e7fde1987 mdoc(7) police: LIBRARY should be before SYNOPSIS. 2001-03-29 13:03:23 +00:00
jedgar
32eba51c0e Correct function name: acl_clear_perm -> acl_clear_perms 2001-03-29 00:48:54 +00:00
ben
7db0207c0f Catch up with a comment that changed in rev1.73 of mount.h
PR:		25836
Submitted by:	Tony Finch <dot@dotat.at>
2001-03-29 00:29:00 +00:00
peter
e6dcf22158 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
phk
623011b46f The f_syncreads and f_asyncreads entries are missing from the man page.
This also tidies up the formatting a bit and omits all the padding
entries.

PR:		25834
Submitted by:	Tony Finch <dot@dotat.at>
2001-03-28 18:21:54 +00:00
ru
1d750dc650 Bye-bye /usr/lib/libtelnet.a. This should fix ``make release'' brokeness.
Approved by:	markm
2001-03-28 12:08:22 +00:00
peter
05f8a97316 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
b47a8aea31 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
rwatson
af5c142ebd o De-uglify IMPLEMENTATION NOTES section by removing unnecessary use of
.Fx
2001-03-28 01:03:33 +00:00
wpaul
5927b134b9 Add a CLSET_ASYNC command, which allows us to (ab)use the clnt_dg transport
to make asynchronous RPCs. This is needed to help fix ypbind, which can no
longer override the clnt_dg_call() method (formerly the clntudp_call()
method) due to all the internal descriptor locking code in TI-RPC. Turning
on this flag allows us to send an RPC request, then return immediately,
and handle a reply later, rather than being forced to do the request
and reply in a single function call.

Also fix a byte ordering bug: when clnt_dg_call() increments the XID
prior to transmitting a request, it uses the raw value, which is wrong.
The XID is stored in network byte order, i.e. big-endian. The CLSET_XID
and CLGET_XID commands in clnt_dg_control() use ntohl()/htonl() to get
the byte ordering right, but because clnt_dg_call() does not do this,
using CLSET_XID/CLGET_XID doesn't actually work, unless you're on a
big endian host, which we aren't (yet). Fix clnt_dg_call() to byte swap
properly when doing the increment.
2001-03-27 21:27:33 +00:00
cwt
54127cc6ae Document LOG_CONSOLE. 2001-03-27 19:55:53 +00:00
ru
f85a17a1d7 MAN[1-9] -> MAN. 2001-03-27 17:27:19 +00:00
alfred
a44e6455e2 give the "netgrent" functions a home in netdb.h 2001-03-27 09:49:03 +00:00
alfred
3569204368 const'ify 2001-03-27 09:43:09 +00:00
ken
3b195d6418 Rewrite of the CAM error recovery code.
Some of the major changes include:

	- The SCSI error handling portion of cam_periph_error() has
	  been broken out into a number of subfunctions to better
	  modularize the code that handles the hierarchy of SCSI errors.
	  As a result, the code is now much easier to read.

	- String handling and error printing has been significantly
	  revamped.  We now use sbufs to do string formatting instead
	  of using printfs (for the kernel) and snprintf/strncat (for
	  userland) as before.

	  There is a new catchall error printing routine,
	  cam_error_print() and its string-based counterpart,
	  cam_error_string() that allow the kernel and userland
	  applications to pass in a CCB and have errors printed out
	  properly, whether or not they're SCSI errors.  Among other
	  things, this helped eliminate a fair amount of duplicate code
	  in camcontrol.

	  We now print out more information than before, including
	  the CAM status and SCSI status and the error recovery action
	  taken to remedy the problem.

	- sbufs are now available in userland, via libsbuf.  This
	  change was necessary since most of the error printing code
	  is shared between libcam and the kernel.

	- A new transfer settings interface is included in this checkin.
	  This code is #ifdef'ed out, and is primarily intended to aid
	  discussion with HBA driver authors on the final form the
	  interface should take.  There is example code in the ahc(4)
	  driver that implements the HBA driver side of the new
	  interface.  The new transfer settings code won't be enabled
	  until we're ready to switch all HBA drivers over to the new
	  interface.

src/Makefile.inc1,
lib/Makefile:		Add libsbuf.  It must be built before libcam,
			since libcam uses sbuf routines.

libcam/Makefile:	libcam now depends on libsbuf.

libsbuf/Makefile:	Add a makefile for libsbuf.  This pulls in the
			sbuf sources from sys/kern.

bsd.libnames.mk:	Add LIBSBUF.

camcontrol/Makefile:	Add -lsbuf.  Since camcontrol is statically
			linked, we can't depend on the dynamic linker
			to pull in libsbuf.

camcontrol.c:		Use cam_error_print() instead of checking for
			CAM_SCSI_STATUS_ERROR on every failed CCB.

sbuf.9:			Change the prototypes for sbuf_cat() and
			sbuf_cpy() so that the source string is now a
			const char *.  This is more in line wth the
			standard system string functions, and helps
			eliminate warnings when dealing with a const
			source buffer.

			Fix a typo.

cam.c:			Add description strings for the various CAM
			error status values, as well as routines to
			look up those strings.

			Add new cam_error_string() and
			cam_error_print() routines for userland and
			the kernel.

cam.h:			Add a new CAM flag, CAM_RETRY_SELTO.

			Add enumerated types for the various options
			available with cam_error_print() and
			cam_error_string().

cam_ccb.h:		Add new transfer negotiation structures/types.

			Change inq_len in the ccb_getdev structure to
			be "reserved".  This field has never been
			filled in, and will be removed when we next
			bump the CAM version.

cam_debug.h:		Fix typo.

cam_periph.c:		Modularize cam_periph_error().  The SCSI error
			handling part of cam_periph_error() is now
			in camperiphscsistatuserror() and
			camperiphscsisenseerror().

			In cam_periph_lock(), increase the reference
			count on the periph while we wait for our lock
			attempt to succeed so that the periph won't go
			away while we're sleeping.

cam_xpt.c:		Add new transfer negotiation code.  (ifdefed
			out)

			Add a new function, xpt_path_string().  This
			is a string/sbuf analog to xpt_print_path().

scsi_all.c:		Revamp string handing and error printing code.
			We now use sbufs for much of the string
			formatting code.  More of that code is shared
			between userland the kernel.

scsi_all.h:		Get rid of SS_TURSTART, it wasn't terribly
			useful in the first place.

			Add a new error action, SS_REQSENSE.  (Send a
			request sense and then retry the command.)
			This is useful when the controller hasn't
			performed autosense for some reason.

			Change the default actions around a bit.

scsi_cd.c,
scsi_da.c,
scsi_pt.c,
scsi_ses.c:		SF_RETRY_SELTO -> CAM_RETRY_SELTO.  Selection
			timeouts shouldn't be covered by a sense flag.

scsi_pass.[ch]:		SF_RETRY_SELTO -> CAM_RETRY_SELTO.

			Get rid of the last vestiges of a read/write
			interface.

libkern/bsearch.c,
sys/libkern.h,
conf/files:		Add bsearch.c, which is needed for some of the
			new table lookup routines.

aic7xxx_freebsd.c:	Define AHC_NEW_TRAN_SETTINGS if
			CAM_NEW_TRAN_CODE is defined.

sbuf.h,
subr_sbuf.c:		Add the appropriate #ifdefs so sbufs can
			compile and run in userland.

			Change sbuf_printf() to use vsnprintf()
			instead of kvprintf(), which is only available
			in the kernel.

			Change the source string for sbuf_cpy() and
			sbuf_cat() to be a const char *.

			Add __BEGIN_DECLS and __END_DECLS around
			function prototypes since they're now exported
			to userland.

kdump/mkioctls:		Include stdio.h before cam.h since cam.h now
			includes a function with a FILE * argument.

Submitted by:	gibbs (mostly)
Reviewed by:	jdp, marcel (libsbuf makefile changes)
Reviewed by:	des (sbuf changes)
Reviewed by:	ken
2001-03-27 05:45:52 +00:00
rwatson
5bb740f806 o Update copyright date
o Revise description in light of commits over last month including:
  - ACL editing library is now implemented
  - ACLs are now implemented

Obtained from:	TrustedBSD Project
2001-03-26 19:55:35 +00:00
ru
dc8a9721eb Do not build (and install) both secure/ and standard versions
of libtelnet, telnetd, and telnet.  This only worked because
secure/ was listed late in SUBDIR in Makefile.inc1.

Reviewed by:	markm
2001-03-26 12:49:05 +00:00
ru
1b9684f704 Don't use MANDEPEND and MANSRC. 2001-03-26 07:28:26 +00:00
brian
0f2a727739 Make header files conform to style(9).
Reviewed by (*): bde

(*) alias_local.h only got a cursory glance.
2001-03-25 12:05:10 +00:00
brian
2db1ee450f Remove an extraneous declaration. 2001-03-25 03:34:29 +00:00
peter
71430e6175 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
des
48193cad2a Use high port range by default, and replace the 'h' option with an 'l' option
that forces the ftp code to use the low (default) port range instead.
2001-03-24 00:28:57 +00:00
obrien
544879c114 Fix rcsid/$FreeBSD$.
Reduce diff from what I think is the original sources.
2001-03-24 00:22:13 +00:00
alfred
af801db67e fix Alpha support 2001-03-24 00:07:06 +00:00
ume
217679d9da IPv4 address is not unsigned int. This change introduces in_addr_t.
PR:		9982
Adviced by:	des
Reviewed by:	-alpha and -net (no objection)
Obtained from:	OpenBSD
2001-03-23 18:59:31 +00:00
alfred
3e027a2ff3 change callrpc() from taking "char *" args, I'm quite sure they really meant
to use "void *".

remove a duplicate prototype for callrpc() from libexec/ypxfr/ypxfr_extern.h
2001-03-23 16:14:49 +00:00
ru
1802b73f04 mdoc(7) police: fix markup. 2001-03-23 14:01:28 +00:00
jedgar
7318be84bf Correct the acl_set_permset and acl_set_tag_type man pages
which somehow got mixed up with the acl_get_* man pages.

Submitted by:	ru
2001-03-23 11:30:31 +00:00
ru
4854102cc9 mdoc(7) police: fix markup. 2001-03-23 09:39:35 +00:00
ru
9d71cc7b65 mdoc(7) police: fix markup, function prototype, and RETURN VALUES text. 2001-03-23 09:38:43 +00:00
jedgar
019574eb8b Add the following ACL editing functions:
acl_add_perm, acl_clear_perms, acl_copy_entry, acl_create_entry,
  acl_delete_perm, acl_get_permset, acl_get_qualifier, acl_get_tag_type,
  acl_set_permset, acl_set_qualifier, acl_set_tag_type

This brings us within 4 functions of a full ACL editing library.

Reviewed by:	rwatson
2001-03-22 22:31:01 +00:00
alfred
c3c6ed25b4 Remove struct cmessage from sys/socket.h and reintroduce the private
definitions.

Requested by: wollman
2001-03-22 20:43:13 +00:00
brian
fae9f68dcc Remove (non-protected) variable names from function prototypes. 2001-03-22 11:55:26 +00:00
alfred
1d6a205da2 Hopefully fix some of the bugs in passing credentials over UNIX domain sockets.
Make struct cmessage visible from socket.h (about 4 places were
defining it for themselves which wasn't good)

Make __rpc_get_local_uid() useable and give it prototype that's
visible.

Fix some issues with printing out usernames from rpcbind and keyserv.
2001-03-22 04:31:30 +00:00
rwatson
1746d8c959 o Slap some "_"'s in front of variable names relating to extattr functions,
so as not to pollute application namespace.

Submitted by:	bde
2001-03-22 04:05:40 +00:00
peter
106b391465 Help standalone builds by getting libutil.h from src/lib/libutil 2001-03-21 22:54:59 +00:00
peter
2dec21f8a1 Find <libkvm.h> in the source tree. This helps standalone builds. 2001-03-21 22:52:48 +00:00
ache
fc9435ad8a Get rid of non-standard %E[Ff] formats, userland apps already fixed 2001-03-21 14:52:12 +00:00
ache
3708c577aa Oops, back out prev. change - POSIX require %y in d_fmt
Cosmetique - use exact POSIX string for %c
2001-03-21 14:12:37 +00:00
ache
40cb12aa04 Replace %y with %Y 2001-03-21 13:55:09 +00:00
ps
ffd8d6d0f6 Add libssl and libcrypto compat4x libraries since the major number
changed.  These were taken from the 4.2-RELEASE dist on ftp.freebsd.org.
This will be MFC'd shortly as it is required in RELENG_4 to maintain
compatability with binaries linked against these libraries.
2001-03-21 08:49:02 +00:00
alfred
bbf084795e whitespace cleanup 2001-03-20 20:28:09 +00:00
ru
47f80f72d0 Fixed some typos. 2001-03-20 10:47:21 +00:00
ru
6ec95437de This manpage is heavily based on the old rpc.3 manpage, and
should have been repo-copied from it in the first place.

Apply all of our fixes up to and including revision 1.14 to
the original rpc.3 manpage, including conversion to mdoc(7).
2001-03-20 10:46:22 +00:00
ru
d4e7c9af3c Removed the second copy of the manual page! 2001-03-20 09:02:32 +00:00
ru
d0e26d44c3 Removed duplicate $FreeBSD$. 2001-03-20 08:51:20 +00:00
dd
63c0a7f22c Make it clear who can and can't set the UF_NODUMP, UF_OPAQUE, and
SF_ARCHIVED file flags.

PR:		25227
Approved by:	nik
2001-03-19 23:51:09 +00:00
jlemon
1c9c714c7e 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
13005eb45a 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
ache
eafc55700d Implement D_MD_ORDER (local extension) to get month/day order from locale 2001-03-19 11:55:12 +00:00
ru
95c5300f72 mdoc(7) police:
- lowercase Nd argument
- mark function arguments with Fa
- mark defined values with Dv
- simply copying POSIX text for RETURN VALUES and ERRORS sections is not
  always a good idea.  POSIX uses the word "shall" indicating the behavior
  the correct implementation should follow.
2001-03-19 08:08:22 +00:00
rwatson
9afee40bb3 o Rename "namespace" argument to "attrnamespace" as namespace is a C++
reserved word.

Submitted by:	jkh
Obtained from:	TrustedBSD Project
2001-03-19 05:05:41 +00:00
rwatson
0459fcb97a o Rename "namespace" argument to "attrnamespace" as namespace is a C++
reserved word, causing breakage when a C++ program included libutil.h
  This change will be propagated elsewhere shortly.

Submitted by:	jkh
Obtained from:	TrustedBSD Project
2001-03-19 05:04:30 +00:00
jedgar
31070ebd5f Add the following POSIX 1003.1e functions and man pages:
o acl_calc_mask(): calculates the ACL mask entry associated with
    the given ACL.
  o acl_delete_entry(): remove a specified ACL entry from the given
    ACL.

Approved by:	rwatson
2001-03-19 03:19:51 +00:00
obrien
4ae8e7a712 Libraries should _never_ call exit() themselves (or its alternate spelling
`err()').  libdisk does! and additionally libdisk gets confused on Alpha
disks with foreign disklabels, throws up its hands and exits.  This is
the cause of the "going no where without my init" install bug on the Alpha.

So now on the Alpha, rather than call err(), we print the error string and
continue processing.

Submitted by:	jkh
2001-03-18 21:30:11 +00:00
ache
c8988abb75 Fix typo in the comment 2001-03-18 12:20:38 +00:00
ache
24b2df4ff9 Relax local FreeBSD restrictions on 3 chars abbrev. name length and %c format
since they not allows POSIXly legal locale data. Currently, if relaxed form
POSIXly legal locale data will be used right now, some programs will be broken,
but it means that either locale data or programs must be fixed, not the library.

Introduce non-standard md_order (month/day order) locale field to be used later
via nl_langinfo(). Currently %EF and %Ef emulated using this field, but they
planned for remove in future in favour of nl_langinfo() test field.

Implement %F per POSIX
2001-03-18 11:58:15 +00:00
ache
74d0c03bd9 Make 'A' and 'a', 'B' and 'b' the same, per POSIX 2001-03-18 08:41:06 +00:00
ume
0d70c14a65 Nuke non-standard EAI_RESNULL. 2001-03-17 14:25:23 +00:00
brian
4b8b237f29 Fix some further style nits
Pointed out by: bde
2001-03-17 10:09:52 +00:00
phk
f3af16b3ba Add a new entrypoint to the hashes in libmd:
char *
  FooFileChunk(const char *filename, char *buf, off_t offset, off_t length)
Which only hashes part of a file.
Implement FooFile() in terms of this function.

Submitted by:	roam
2001-03-17 10:00:50 +00:00
dillon
da83455a02 Fix type-o
Submitted by: okazaki
2001-03-16 22:18:26 +00:00
jlemon
0e5439e79f 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
ru
df6d18791c mdoc(7) police: ``It'' macro does not take argument in -enum lists.
(In -mdocNG, this only causes warning.  In current implementation,
it is fatal.)

Pointy hat to:	markm (for not checking stderr)
2001-03-16 12:06:26 +00:00
dd
81e9eabe15 Correct descriptions of SOCK_RDM and SOCK_SEQPACKET.
PR:		25797
Submitted by:	Yuko Sasaki <yuko@veltec.co.jp>
Approved by:	nik
2001-03-16 01:18:03 +00:00
dwmalone
7944e9afd6 Correct spelling of MNT_ASYNC.
PR:		25835
Submitted by:	Tony Finch <dot@dotat.at>
2001-03-15 19:52:04 +00:00
jlemon
61828670c6 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
fc5cfeada8 Mention that MAXHOSTNAMELEN includes space for the NUL. 2001-03-15 08:35:53 +00:00
brian
9cdad402ba Actually commit the new version of trimdomain *blush*
Thanks for covering my blunder to:	peter
2001-03-15 08:30:05 +00:00
rwatson
808ce2d0f8 o To support new EA interface with explicit namespaces, introduce two
utility functions which convert between string namespace names and
  numeric constants used by the interface.  Right now, two namespaces
  are supported, EXTATTR_NAMESPACE_SYSTEM ("system") and
  EXTATTR_NAMESPACE_USER ("user").  These functions are used by
  various userland EA utilities, rather than hard coding the routines
  all over the place.

Obtained from:	TrustedBSD Project
2001-03-15 03:00:39 +00:00
dd
a5ed797e7e Make tdelete(3), tfind(3), and twalk(3) links to tsearch(3).
Approved by:	nik
2001-03-15 01:53:17 +00:00
peter
cf14f72d94 It would help if trimdomain.c was actually committed. This is a stopgap
world-unbreaker until Brian Somers commits the one he intended to.

Pointy Hat to: brian
2001-03-15 00:15:22 +00:00
brian
a01fd47f80 Move trimdomain() into it's own source file and tidy things up a bit.
Fix disorder in the Makefile.

Reviewed (mostly) by: bde
2001-03-14 20:51:15 +00:00
brian
7a448221c2 MAXHOSTNAMELEN includes space for the NUL
Don't read past the end of the host passed to realhostname()

Not objected to by: freebsd-audit
Interface disliked by: imp
2001-03-14 20:50:52 +00:00
rwatson
7334b10dcd o Update copyright dates.
o Rename internal library functions so that they are prefixed with
  _posix1e or _POSIX1E, removing them from the application namespace (and
  potential conflict with other ACL functions elsewhere in the system).

Obtained from:	TrustedBSD Project
2001-03-13 02:31:32 +00:00
dd
510e2aec7d Document the rest of the possible return codes.
PR:		25188
Approved by:	nik
2001-03-13 01:08:36 +00:00
ru
a196417780 .St -p1003.1g -> .St -p1003.1g-2000. 2001-03-12 17:28:01 +00:00
markm
969dd78ed1 Updates for Blowfish password hashing. 2001-03-11 16:37:33 +00:00
markm
a4013287b2 Add OpenBSD-style blowfish password hashing. This makes one less
gratuitous difference between us and our sister project.

This was given to me _ages_ ago. May apologies to Paul for the length
of time its taken me to commit.

Obtained from:	Niels Provos <provos@physnet.uni-hamburg.de>/OpenBSD
Submitted by:	Paul Herman <pherman@frenchfries.net>
2001-03-11 16:05:43 +00:00
billf
1e9466ca03 In theory it would be perfectly legal for a system administrator to
# cd /dev && ./MAKEDEV pty0 pty3
and/or
# rm -rf /dev/ptyp0

and expect all programs that use openpty() to still try to find available ptys.
2001-03-10 10:39:52 +00:00
deischen
c40e257eca Correct a race condition where it was possible for a signaled
thread to become stranded and not placed in the run queue.

MFC Candidate

Reported by:	tegge
2001-03-09 16:05:43 +00:00
ru
fdca1e179c This is the getsid() we are talking about, not setsid().
PR:		docs/25626
Submitted by:	Yoshihiko Sarumaru <mistral@imasy.or.jp>
2001-03-09 11:16:09 +00:00
dec
6a881538c0 Submitted by: Ian Dowse <iedowse@maths.tcd.ie>, David Cross <dec@freebsd.org>
Reviewed by:	David Cross <dec@freebsd.org>, jkh <jkh@freebsd.org>
Approved by:	jkh <jkh@freebsd.org>
Obtained from:	Ian Dowse <iedowse@maths.tcd.ie>, David Cross <dec@freebsd.org>
We have been running this patch on a production NIS server for 2.5 weeks now.
Normally we would have ypserv die at least once a week, and often many times
a day.

This patch treats and error from select as zeroing out the FD_SET to indicate
that no fds are ready for reading.  This is safe because the rpc code
always re-inits the FDSET before calling select.
2001-03-08 13:57:41 +00:00
des
f37ee25c50 Don't remember an EINTR, since the caller may want to restart the call. 2001-03-07 05:12:14 +00:00
des
e43579a28c Support lower-case versions of the proxy environment variables.
PR:		bin/25494
2001-03-07 04:45:55 +00:00
dfr
6980695ad6 A quick and dirty port of libstand to ia64. 2001-03-06 16:11:36 +00:00
dfr
0e04b31ae2 Use relative paths to find byte_swap_*.S to make it easier to use these
from libstand.
2001-03-06 16:08:19 +00:00
dfr
e8dc841519 Make this compile. Still need to write/borrow a working setjmp. 2001-03-06 16:07:41 +00:00
dfr
7e10a3c091 Use ieee floats on ia64. 2001-03-06 16:06:38 +00:00
dwmalone
979182141f Use the right format string for printing ULONG_MAX. 2001-03-05 11:58:12 +00:00
obrien
d81d70f46b Fix style nit. 2001-03-05 11:10:12 +00:00
obrien
c3f2ce780d Fix style breakage. 2001-03-05 11:06:18 +00:00
obrien
43a631e681 Fix style that got corrupted. 2001-03-05 10:39:03 +00:00
obrien
6d5d306d77 Fix FreeBSD id style breakage from rev 1.17 2001-03-05 10:30:12 +00:00
obrien
4455d367fd Use our standard .c rcsid format. 2001-03-05 10:21:05 +00:00
obrien
fcfc5287a6 Fix copyright breakage in rev 1.2.
We *cannot* remove clause #4 from the Univ of California's license.
2001-03-05 10:18:15 +00:00
obrien
e5aa652797 Correct a comment. 2001-03-05 10:00:57 +00:00
obrien
9486bd5024 Fix style breakage in rev 1.3 2001-03-05 09:33:08 +00:00
obrien
fc92ac095a Fix style bug that was introduced. 2001-03-05 09:21:44 +00:00
ache
42b02a510e Change mon_decimal_point from "." to "" (N/A>) as it is specified by POSIX for
POSIX locale.
2001-03-03 21:03:15 +00:00
ache
8242002fcf Actually implement T_FMT_AMPM 2001-03-02 22:12:19 +00:00
ache
e4ea20c3a0 Implement ampm_fmt (%r) per POSIX 2001-03-02 22:10:04 +00:00
ru
0d436c8d9c Removed duplicate $FreeBSD$. 2001-03-02 13:00:26 +00:00
ru
7275ff87ea Fix setlocale() to conform to the ISO C and POSIX standards.
The below text is quoted from the latest POSIX draft:

: The values of locale categories shall be determined by a precedence
: order; the first condition met below determines the value:
:
: 1. If the LC_ALL environment variable is defined and is not null,
:    the value of LC_ALL shall be used.
: 2. If the LC_* environment variable (LC_COLLATE, LC_CTYPE, LC_MESSAGES,
:    LC_MONETARY, LC_NUMERIC, LC_TIME) is defined and is not null, the
:    value of the environment variable shall be used to initialize the
:    category that corresponds to the environment variable.
: 3. If the LANG environment variable is defined and is not null, the
:    value of the LANG environment variable shall be used.
: 4. If the LANG environment variable is not set or is set to the empty
:    string, the implementation-defined default locale shall be used.

The conditions 1 and 2 were interchanged, i.e., LC_* were looked first,
then LC_ALL, then LANG (note that LC_ALL and LANG were essentially the
same, providing the default, with LC_ALL taking precedence over LANG).
Now, LC_ALL and LANG serve the different purposes.  LC_ALL overrides
any LC_*, and LANG provides the default fallback.

Testcase:

/usr/bin/env LC_ALL=C LC_TIME=de_DE.ISO_8859-1 /bin/date

Should return date in the "C" locale format.

Inspired by:	date(1) reference page in the Draft
2001-03-02 12:45:52 +00:00
ru
11200a6edf mdoc(7) police: fix markup. 2001-03-02 09:59:58 +00:00
deischen
0b681e5fda Hide the definition of struct __sFILEX and add the needed
lock definitions to it.  flockfile state is now allocated
along with the rest of FILE.  This eliminates the need for a
separate allocation of flockfile state as well as eliminating
the mutex/lock used to serialize its allocation.
2001-03-01 05:22:14 +00:00
deischen
efe84f0830 s/fstat/_fstat/
Approved by:	phantom
2001-03-01 04:59:01 +00:00
obrien
ac7e3b1218 Merge in strtoul.3 rev 1.11 mdoc(7) police changes:
.Nd line broken in rev 1.10
	use .Bx for ``BSD''
2001-02-28 17:46:56 +00:00
ru
0b7f07b8e5 Eliminate mdocNG warnings caused by misplaced or extraneous macro calls. 2001-02-28 17:38:53 +00:00
jlemon
c423db30e9 Use the new EV_SET macro to insure that all fields in struct kevent
are correctly initialized before use.  This should fix the problem
with DNS.

Pointy hat to:  me
2001-02-28 15:47:47 +00:00
ru
090237ffbe mdoc(7) police: prepare for mdocNG. 2001-02-28 13:11:51 +00:00
ru
af53167ba5 mdoc(7) police: fix the .Nd line broken in previous revision.
Noticed by:	bde

Use .Bx for ``BSD''.
2001-02-28 12:54:16 +00:00
obrien
03e1213d7f Remove the `r' devices. 2001-02-27 23:29:13 +00:00
ache
51e220082c Use formula with better random distribution for rand()
Even better formula from random() could not be intetgrated because rand_r()
supposed to store its state in the single variable (but table needed for
random() algorithm integration).
2001-02-27 14:42:19 +00:00
obrien
3cdfa59ee2 I accidently deleted an include when I added the $FreeBSD$ so I could
check in my changes.
2001-02-27 14:30:42 +00:00
ru
91c8023e63 In soshutdown(), use SHUT_{RD,WR,RDWR} instead of FREAD and FWRITE.
Also, return EINVAL if `how' is invalid, as required by POSIX spec.
2001-02-27 13:48:07 +00:00
obrien
9890a827d4 Impliment the ISO-C99 strto[u]ll()
and rewrite strto[u]q() in terms of it.
2001-02-27 13:33:07 +00:00
ru
4c73555a60 Use ``.St -p1003.[12]''. 2001-02-26 16:12:39 +00:00
ru
f0fc971abb Use ``.St -p1003.1g''. 2001-02-26 16:08:15 +00:00
ru
bf982093d7 Use ``.St -p1003.1-96''. 2001-02-26 15:16:43 +00:00
ru
79b387319c /^\.St/ s/-iso9945-1/-p1003.1-96/ 2001-02-26 14:48:38 +00:00
ru
0b6fcafa7e `.St -p1003.1b'' -> `.St -p1003.1b-93''. 2001-02-26 14:33:54 +00:00
ru
f2ef0fa6fe .St -ansiC -> .St -isoC 2001-02-26 13:23:47 +00:00
jasone
5ec7f1a58c Document the EINTR error. 2001-02-26 09:38:01 +00:00
ru
410cbe5afd mdoc(7) police: use .Vt macro. 2001-02-26 09:15:17 +00:00
ru
0b8c9cff2d Prepare for mdocNG. 2001-02-26 09:05:48 +00:00
jlemon
d03253e304 Document various changes to kq:
- new EV_SET macro,
    - NOTE_LOWAT option for low water marks on read/write filters,
    - NOTE_REVOKE for filesystem unmounting (and revoke() calls)
    - improved API for EVFILT_AIO
2001-02-26 04:16:19 +00:00
deischen
bf7c90061e Really set the flags for a private mutex (used by libc/libc_r). 2001-02-26 01:06:52 +00:00
deischen
d9ad338640 Limit threads clock resolution to no less than 1000usec (1000Hz).
PR:		25300
Submitted by:	Tom Pavel <pavel@alum.mit.edu> (in part)
2001-02-26 01:05:33 +00:00
olgeni
868cd470b4 Fix my ambiguous message about ECONNABORTED.
Submitted by:	Ian Dowse <iedowse@maths.tcd.ie>
2001-02-25 23:56:41 +00:00
olgeni
d6ad47f58b Add ECONNABORTED to the ERRORS section. 2001-02-25 22:12:40 +00:00
tegge
5996b6cbc7 Update unused __dtoa prototypes to match reality. 2001-02-25 08:51:41 +00:00
phantom
0b95729f10 Fix visibility of empty variable -- it should be static.
Submitted by:	bde and Hartmut Brandt <brandt@fokus.gmd.de> (via PR)
PR:		bin/25308
2001-02-24 13:13:48 +00:00
rwatson
b657f7ea19 Adapt libkvm_getswapinfo() to make use of recently committed vm and swap
sysctls exporting swap information.  When running on a live kernel,
the sysctl's will now be used instead of kvm_read, allowing consumers of
this interface to run without privilege (setgid kmem).  Retain the
ability to run on coredumps, or on a kernel using kmem if explicitly
pointed at one.

A side effect of this change is that kvm_getswapinfo() is faster now in
the general case. If the SWIF_DUMP_TREE flag is given (pstat -ss does
this), the radix tree walker, which still uses kvm_read in any case, is
invoked, and therefore does require privilege.

Submitted by:	Thomas Moestl <tmoestl@gmx.net>
Reviewed by:	freebsd-audit
2001-02-23 18:49:16 +00:00
green
c13abd3c6b Correctly handle the race itself, too (don't leave it locked).
This is about to be replaced anyway by initialization explicitly
instead of lazily, and reducing the complexity of it.  As it is
now, this will work fine, however.
2001-02-23 17:55:01 +00:00
green
42a0d6aa76 Use the right names to call pthread_mutex_{,un}lock so that things
work in both the libc only and libc/libc_r case.
2001-02-23 06:26:22 +00:00
green
78d4c24cd2 Fix the problems I (and others, undoubtedly) have been having for a
while with threaded software in -CURRENT acting very "weird".  It has
seemed, for example, in Mozilla that threads attempting to do host
lookups have been locking up.  That's exactly the case.

There was a race condition in the implementation of the initialization
of the mutex used to protect FILE operations, first of all: multiple
instances of FLOCKFILE() in libc could occur on the same FILE at
the same time and cause strange behavior by overwriting eachothers'
creation of the mutex and the rest of the file lock.

Secondly, it's not appropriate to test the "validity" of the file
descriptor referenced by the FILE; if the code is calling FLOCKFILE()
or FUNLOCKFILE(), it wants the FILE to be locked or unlocked, not
to be locked or unlocked on the condition that _file is >= 0.  This
also could quite easily cause leaks by failing to perform the lock or
unlock operation when it actually is needed.

Mozilla now works again on -CURRENT when linked to libc_r.so.5 and
libc.so.5.
2001-02-23 04:59:12 +00:00
ru
6d04909a5e Prepare for mdoc(7)NG. 2001-02-22 15:03:09 +00:00
dcs
1053441568 Correct the prototype for pager_output(). 2001-02-22 10:58:30 +00:00
kris
ea232a63e7 Correct comment typos 2001-02-20 10:23:10 +00:00
peter
444ebb8209 Place some hooks (__stdin, __stdout, __stderr) into libc for a future
ABI change.  There is some serious evilness here to work around some
gcc weaknesses.  We need to know the sizeof(FILE) manually until __sF
goes away in the next major bump.  We have the size for Alpha and i386,
missing is ia64, ppc and sparc* (and i386 with 64 bit longs).
At some point down the track we can change the stdin etc #defines to
stop hard coding the size of FILE into application binaries.

Lots of head scratching and ideas and testing by: green, imp
2001-02-20 01:56:52 +00:00
phantom
0048882c9c cleanup commentaries 2001-02-19 19:09:00 +00:00
ume
d06c8a8880 Enable AI_ADDRCONFIG as a valid flag of getaddrinfo(3). Some
applications specify AI_ADDRCONFIG and fail to run under FreeBSD.
Latest mews is known.  Now, getaddrinfo(3) behaves according to
AI_ADDRCONFIG.
2001-02-19 13:13:51 +00:00
ache
703ab4ba84 Deal properly with "0" 2001-02-19 06:19:51 +00:00
asmodai
a667ae6c5c Preceed/preceeding are not english words. Use precede or preceding. 2001-02-18 10:25:42 +00:00
kris
a4c13915e2 Silence -Wnon-const-format 2001-02-18 04:51:47 +00:00
kris
29f7e1407b Back out snprintf -> sprintf change until I have time to look at it. 2001-02-18 04:07:50 +00:00
ache
deeb685ccf CRNCYSTR: determine '.' too 2001-02-17 11:15:30 +00:00
ache
f0f13bd854 Implement CRNCYSTR 2001-02-17 07:35:01 +00:00
imp
c10bf83024 Extra needs to be initialized for our usual pool of FILEs. This was
causing some versions of as to dump core.  This survived make
buildworld/installworld and the building gettext port afterwards.

Submitted by: <nnd@mail.nsk.ru> "N.Dudorov"
Reviewed by: "Daniel M. Eischen" <eischen@vigrid.com>
2001-02-16 21:09:49 +00:00
imp
5e10e50b59 Fix the current libc breakage in current:
o Back out the __std* stuff.  Can't figure out how to do this right now,
  so we'll save it for late.
o use _up as a pointer for extra fields that we need to access.
o back out the libc major version bump.

Submitted by: green
reviewed by: peter, imp, green, obrien (to varying degrees).

We'll fix the "how do we stop encoding sizeof(FILE) in binaries" part
later.
2001-02-16 06:11:22 +00:00
tegge
2793a9d7f9 Don't depend on lcl_mutex being a recursive mutex.
Reviewed by:	deischen
2001-02-15 22:17:04 +00:00
tegge
38ec42f445 Remove freelists managed by Balloc/Bfree.
Change __dtoa to not free the string it allocated the previous time it was
called.  The caller now frees the string after usage if appropiate.

PR:		15070
Reviewed by:	deischen
2001-02-15 22:12:50 +00:00
ume
eec882b4a9 Correct 2nd argument of getnameinfo(3) to socklen_t.
Reviewed by:	itojun
2001-02-15 10:35:55 +00:00
peter
bcdb9042a1 List the SA_RESTART flag rather than burying it in another paragraph. 2001-02-14 21:46:07 +00:00
obrien
5afa43af2c Only build the compat libs appropiate for the target machine. 2001-02-14 20:49:54 +00:00
guido
42fc95c997 Add include <sys/time.h> because kevent uses struct timespec 2001-02-14 08:48:35 +00:00
peter
24e8063c2f Commit a libc fix going by the current state of the version numbering
bikeshed in -arch.  It isn't quite over, but it has been well established
that this can be adjusted or refined.  But we do seem to have consensis
on a major bump of some sort.  After this, it should reasonably safe
to build world again.

This change is to get rid of __sF[] and use seperate __stdin/out/err
handles.  This means we can pad on extra bits onto the end of FILE
at will without going through this all over again.  __sF[] was evil
because it compiled the sizeof(FILE) into every stdio using program.

Asbestos suit on: check!
Peril sensitive sunglasses on: check!
*gulp!*
2001-02-14 05:00:20 +00:00
ache
ece65e7270 Return {YES,NO}STR from locale
Approved by:	phantom
2001-02-13 23:32:48 +00:00
phantom
54fd7f1296 catch up to __part_load_locale() interface change 2001-02-13 15:32:21 +00:00
phantom
81a77b6514 add additional function parameter: bufsize_min. it's possible
to check two sizes per one function invocation now.

Suggested by: ache
2001-02-13 15:29:39 +00:00
ru
3c855faf04 mdoc(7) cleanup. 2001-02-12 15:16:24 +00:00
ru
4667e814ee Sort PROT_* and MAP_* lists, logically and alphabetically respectively.
Suggested by:	bde

General mdoc(7) cleanup.
2001-02-12 10:14:15 +00:00
phantom
a4b1c7adbd Make comparsions more clear (per style(9)) 2001-02-12 08:56:39 +00:00
phantom
72ac52b3f2 Assume that "" passed as parameter also means "no grouping"
Make comparsions more clear (per style(9))
2001-02-12 08:55:12 +00:00
phantom
44694affa1 Rewrite __time_load_locale() using ldpart.c::__part_load_locale()
Reviewed by:	ache
2001-02-12 08:53:33 +00:00
phantom
e6d5dad61e Use .Rv macro instead of hardcoded message 2001-02-12 08:42:56 +00:00
ru
7a05da09bb "Cross references in the SEE ALSO section should be sorted by section
number, and then placed in alphabetical order and comma separated.",
mdoc.samples(7) said.
2001-02-12 08:30:22 +00:00
ru
65c172fed6 mmap(3) -> mmap(2). 2001-02-12 08:27:06 +00:00
peter
33f81fe871 It sounded like a good idea at the time. The previous change breaks
FILE *buffer = stdout;
so back it out for now.
2001-02-12 03:31:23 +00:00
peter
261071ecad Take advantage of the current libc sizeof(FILE) breakage (__sF[]) and
try a hopefully more robust stdin/stdout/stderr.  This costs an indirect
pointer fetch, but saves us from changes in 'FILE'.  The __stdin stuff
is there to not pollute application name space if the application does
not use <stdio.h> and also in case something depended on the current
behavior where stdin etc was a #define.

Reviewed by:	eischen, dillon
2001-02-12 02:50:30 +00:00
rwatson
74e79517a9 o Fix build of libc broken in revision 1.2. offsetof() requires the
inclusion of stddef.h.

Reviewed by:	peter
2001-02-12 02:44:33 +00:00
jake
9437320062 Catch up to new priority interface. 2001-02-12 00:21:38 +00:00
deischen
2d14e39d36 Remove (int) file descriptor locking. It should be up to the
application to provide locking for I/O operations.  This doesn't
break any of my tests, but the old behavior can be restored by
compiling with _FDLOCKS_ENABLED.  This will eventually be removed
when it is obvious it does not cause any problems.

Remove most of flockfile implementation, with the exception of
flockfile_debug.

Make error messages more informational (submitted by Mike Heffner
<spock@techfour.net>, who's now known as mikeh@FreeBSD.org).
2001-02-11 22:07:32 +00:00
deischen
bf10167082 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
nik
06a2f1b109 Mention PROT_NONE in the list of possible protections.
Pointed out by:	kris
2001-02-11 19:30:41 +00:00
nik
fcd90bc751 Include mmap(2) in the list of memory allocation functions.
Reviewed by:	hackers
2001-02-11 19:28:36 +00:00
nik
958d489b0f .Xr to mmap. 2001-02-11 18:53:50 +00:00
nik
2b76ec25ed Note that mmap(2) can allocate memory, as well as mapping existing files,
in the .Nd.

Reviewed by:	hackers
2001-02-11 18:51:17 +00:00