Commit Graph

1291 Commits

Author SHA1 Message Date
Daniel Eischen
8450917472 Make usleep() overridable by the thread libraries so they can provide
cancellation points.

Noticed by:	phk
2005-08-03 00:44:25 +00:00
Matthew N. Dodd
50007d443b Move initialization above point of first possible reference to
avoid overwriting ty_status values set from the 'type' field.

Previously TTY_DIALUP and TTY_NETWORK flags did not match
specified type.
2005-07-25 17:57:15 +00:00
Jonathan Chen
c5a096e0e0 fix innetgr() returning false positives and negatives when reverse netgroup
matching is used.

PR: 35506
MFC after: 3 days
2005-07-22 22:20:26 +00:00
Robert Watson
7a6d1e6f69 Cross-reference sem_getvalue(3) from several other semaphore-related
functions.

MFC after:	3 days
2005-07-13 13:15:22 +00:00
Ruslan Ermilov
f789cb8293 Assorted markup fixes.
Approved by:	re
2005-06-15 19:04:04 +00:00
Ruslan Ermilov
d3b3ec17a8 When IPC_NOWAIT is set and there is no message, msgrcv() fails
with errno set to ENOMSG.

PR:		docs/82217
Submitted by:	delphij
Approved by:	re (blanket)
2005-06-14 10:56:02 +00:00
Hajimu UMEMOTO
77cf61aeb0 reduce strlen() call. 2005-05-20 15:39:20 +00:00
Hajimu UMEMOTO
8a4d3d8400 use reentrant.h and simplify. 2005-05-20 15:17:08 +00:00
Hajimu UMEMOTO
532e65b886 check return value of ttyname_r(). 2005-05-20 14:59:20 +00:00
Hajimu UMEMOTO
db297254fe ttyname_r() didn't pass correct buffer size to devname_r(). 2005-05-20 14:56:55 +00:00
Xin LI
68b749ff2f Revert to old ttyname_r behavior that when _ioctl() returns 0 (SUCCEEDED),
return the buffer immediately.  This will permit ssh and/or PAM logins
broken by previous commit.

The (potential) underlying problem is still under investigation.

Point hat to:	me
2005-05-14 14:03:21 +00:00
Xin LI
8dcb56dc78 Provide more POSIX-complaint ttyname_r(3) interface[1], which is slightly
different from what has been offered in libc_r (the one spotted in the
original PR which is found in libthr has already been removed by David's
commit, which is rev. 1.44 of lib/libthr/thread/thr_private.h):
	- Use POSIX standard prototype for ttyname_r, which is,
		int ttyname_r(int, char *, size_t);
	  Instead of:
	  	char *ttyname_r(int, char *, size_t);
	  This is to conform IEEE Std 1003.1, 2004 Edition [1].
	- Since we need to use standard errno for return code, include
	  errno.h in ttyname.c
	- Update ttyname(3) implementation according to reflect the API
	  change.
	- Document new ttyname_r(3) behavior
	- Since we already make use of a thread local storage for
	  ttyname(3), remove the BUGS section.
	- Remove conflicting ttyname_r related declarations found in libc_r.

Hopefully this change should not have changed the API/ABI, as the ttyname_r
symbol was never introduced before the last unistd.h change which happens a
couple of days before.

[1] http://www.opengroup.org/onlinepubs/009695399/functions/ttyname.html

Requested by:	Tom McLaughlin <tmclaugh sdf lonestar org>
Through PR:	threads/76938
Patched by:	Craig Rodrigues <rodrigc crodrigues org> (with minor changes)
Prompted by:	mezz@
2005-05-13 16:27:30 +00:00
Xin LI
f73fd5bd75 Connect MLINKS for ttyname_r(3), and add prototype into unistd.h. 2005-05-11 14:07:25 +00:00
Xin LI
603c9c1dc5 Cleanup for getgrouplist(3):
- Use /*- instead of /* for copyright section
 - Include unistd.h for prototype of it
 - Sort and separate includes as described in style(9)
 - ANSIfy the function defination
 - Use const for the traversing iterator
2005-05-03 16:20:03 +00:00
Xin LI
2f22da5d97 Include paths.h for prototype of getbootfile(3). 2005-05-03 15:28:07 +00:00
David Schultz
fe769cdd95 Add a sysctl that returns the full path of a process' text file.
This information is needed by things like `gdb -p' and Sun's javac,
and previously it could only be obtained via procfs
2005-04-18 02:10:37 +00:00
Stefan Farfeleder
cf00abe993 Remove unused variables and assignments. 2005-04-08 21:24:23 +00:00
Stefan Farfeleder
fd42c4d829 Use prototypes in the function definitions. 2005-04-08 21:15:38 +00:00
David Schultz
5e9b87a863 Add some missing errnos from POSIX. Nothing in FreeBSD generates
these at the moment, but applications that test for them will now
have a better chance of compiling.

I have intentionally omitted errnos that are only good for STREAMS,
since apps that use STREAMS won't compile anyway.  The exception is
EPROTO, which was apparently intended for STREAMS, but worth having
anyway because Linux (mis)uses it for other things.
2005-04-02 12:33:28 +00:00
David Xu
26896bda48 Use __weak_reference macro to define weak symbols. 2005-03-21 13:17:16 +00:00
David Schultz
3edb8f412f Teach fmtcheck() about the ' (thousands separator) flag. 2005-03-21 08:00:55 +00:00
Poul-Henning Kamp
9a9ef8b65a Have ttyname_r() try to ask DEVFS for the device name.
Document ttyname_r().

Simplify threaded/unthreaded stuff a lot.
2005-03-08 21:35:52 +00:00
Poul-Henning Kamp
008aca9807 Make the returnvalue of times(3) insensitive to changes in wall-clock.
PR:	78537
2005-03-08 08:12:35 +00:00
David Schultz
b3bc33db36 Add manpage links for frexpf, frexpl, ldexpf, and ldexpl. 2005-03-07 05:01:04 +00:00
David Schultz
a8af59b5f7 Document frexpl and ldexpl. 2005-03-07 05:00:54 +00:00
David Xu
96a9329375 Fix incorrect comment. 2005-03-01 23:42:00 +00:00
David Xu
17ceb495f0 Mark _rtld_allocate_tls and _rtld_free_tls as weak symbols for Variant I
tls.

Reviewed by: dfr
2005-02-26 10:39:49 +00:00
Tom Rhodes
0e5d513b50 Add an EXAMPLES section[1], quote Nd, and bump doc date.
PR:		53621 [1]
Submitted by:	Faried Nawaz <fn@hungry.com> [1]
2005-02-23 02:02:38 +00:00
Ruslan Ermilov
36a142c455 Expand contractions. 2005-02-13 23:45:54 +00:00
Ruslan Ermilov
0227791b40 Expand *n't contractions. 2005-02-13 22:25:33 +00:00
Ruslan Ermilov
6b806d21d1 Fixed the misplaced $FreeBSD$. 2005-02-09 18:07:17 +00:00
David Schultz
f154b03b25 Update my email address. 2005-02-06 03:23:31 +00:00
David Schultz
29bf6af890 - Move the functions presently described in in ieee(3) to their own
manpages.  They are not very related, so separating them makes it
  easier to add meaningful cross-references and extend some of the
  descriptions.
- Move the part of math(3) that discusses IEEE 754 to the ieee(3)
  manpage.
2005-01-27 05:46:17 +00:00
David Schultz
e33621db7f - Document ldexpf().
- Although ldexp() is in libc for backwards compatibility, ldexpf() is
  in its proper place in libm.  Document both as being in libm.
- The ldexp() and ldexpf() functions conform to C99.
2005-01-23 16:49:49 +00:00
David Schultz
6f1dd8edc0 - Document frexpf().
- Neither frexp() nor frexpf() set errno.
- Although frexp() is in libc for backwards compatibility, frexpf() is
  in its proper place in libm.  Document both as being in libm.
- The frexp() and frexpf() functions conform to C99.
2005-01-23 16:49:40 +00:00
David Schultz
00646ca204 Replace the ldexp() implementation in libc with a renamed copy of the
scalbn() implementation from libm.  (The two functions are defined to
be identical, but ldexp() lives in libc for backwards compatibility.)
The old ldexp() implementation...
  - was more complicated than this one
  - set errno instead of raising FP exceptions
  - got some corner cases wrong
    (e.g. ldexp(1.0, 2000) in round-to-zero mode)

The new implementation lives in libc/gen instead of
libc/$MACHINE_ARCH/gen, since we don't need N copies of a
machine-independent file.  The amd64 and i386 platforms
retain their fast and correct MD implementations and
override this one.
2005-01-22 06:03:40 +00:00
Ruslan Ermilov
24a0682c64 Sort sections. 2005-01-20 09:17:07 +00:00
Ruslan Ermilov
3382f529ff Markup: convert a display to a list. 2005-01-15 11:40:33 +00:00
Jonathan Chen
6920b9cc54 remember to reset nextgrp in getnetgrent(), so that subsequent calls to getnetgrent() doesn't return bogus information.
MFC after:	3 days
2005-01-13 18:33:01 +00:00
Giorgos Keramidas
5abd925f0c The `timep' argument of utime() is not an array of structs.
Make sure we don't confuse the reader by claiming it is.

PR:		docs/75615
Submitted by:	Nobuyuki Koganemaru <n-kogane@syd.odn.ne.jp>
2005-01-07 14:38:29 +00:00
Pawel Jakub Dawidek
a73e1eeda5 Update manual page after adding 'fts_bignum' field.
Submitted by:	Peter Jeremy <PeterJeremy@optushome.com.au>
MFC after:	5 days
2005-01-07 07:03:19 +00:00
Pawel Jakub Dawidek
28644c1bbb Introduce new field 'fts_bignum' which is 64bit long and will allow to
make utilities like du(1) 64bit-clean.
When this field is used, one cannot use 'fts_number' and 'fts_pointer'
fields.

This commit doesn't break API nor ABI.

This work is part of the BigDisk project:

	http://www.FreeBSD.org/projects/bigdisk/

Discussed on:	arch@
MFC after:	5 days
2005-01-07 00:06:20 +00:00
Gleb Smirnoff
9657520621 Make syslog(3) thread safe.
PR:		bin/72394
Submitted by:	Dan Nelson
Reviewed by:	deischen
MFC after:	2 weeks
2004-12-30 16:05:11 +00:00
Kirill Ponomarev
d8c9fa8327 Add LOG_NTP facility.
Submitted by:	Kurt Jaeger <pi at complx dot LF dot net>
Approved by:	ru
MFC after:	3 days
2004-12-30 13:09:34 +00:00
Giorgos Keramidas
678a5ffdd8 Mark up SIGSTOP with .Dv and use .Nm in HISTORY for marking up `signal'.
PR:		docs/75615
Submitted by:	n-kogane@syd.odn.ne.jp
2004-12-29 19:40:56 +00:00
Gleb Smirnoff
8ba85e7741 Restore standard behavior: log to console only when normal logging
failed, not always.

PR:		bin/75356
Submitted by:	Mark Knight <markk knigma org>
Pointy hat to:	glebius
MFC after:	3 days
2004-12-24 09:48:44 +00:00
Joseph Koshy
6e6bc3ed0d Better rendering of the prototype for signal(3).
Suggested by:	ru
2004-12-23 02:48:20 +00:00
Maxim Konovalov
63173f5f56 o The macro versions of sigemptyset(3), sigfillset(3), sigaddset(3),
sigdelset(3) and sigismember(3) were killed about five years ago.

o The functions (specifically sigismember(3)) could return -1 and
set errno.

PR:		bin/75156
Obtained from:	NetBSD
MFC after:	2 weeks

o Bump the date of the document.
2004-12-16 20:27:55 +00:00
Ralf S. Engelschall
b4c6be3254 Fix description: the argument to setcontext(3) must have been previously
initialized "by a call to getcontext(3) or makecontext(3)" and not "by a
call to setcontext(3) or makecontext(3)".

MFC after:	3 days
2004-12-03 14:10:04 +00:00
Mark Santcroos
15579150a4 Remove ntp_gettime.c which was a wrapper around sysctlbyname(3).
This is now a native system call.

Reviewed by:	imp, phk, njl, peter
Approved by:	njl
2004-11-18 23:59:19 +00:00
Bjoern A. Zeeb
6c58990d47 Add knob NO_NIS (fka NO_YP_LIBC) and make world compileable when set.
If turned on  no NIS support and related programs will be built.

Lost parts rediscovered by:	Danny Braniss <danny at cs.huji.ac.il>
PR:		bin/68303
No objections:	des, gshapiro, nectar
Reviewed by:	ru
Approved by:	rwatson (mentor)
MFC after:	2 weeks
2004-11-13 20:40:32 +00:00
Gleb Smirnoff
240d5a9b1c Protect against local flooder of /var/run/log. Do not loop forever in
syslog(3) if we are a priveleged program (sshd, su, etc.).

- Make syslogd open an additional socket /var/run/logpriv, with 0600
  permissions.
- In libc, try to use this socket.
- Do not loop forever if we are using this socket (partial backout of 1.31)

Reviewed by:	dwmalone, Andrea Campi <andrea webcom it>
Approved by:	julian (mentor)
MFC after:	1 month
2004-11-04 23:09:57 +00:00
Gleb Smirnoff
2e89951b6f When send()ing to syslogd return ENOBUFS keep trying until success.
This fixes a case, when DoSed syslogd completely loses messages.

PR:		bin/72366
Discussed with:	dwmalone, millert@OpenBSD.org
Approved by:	julian (mentor)
Obtained from:	OpenBSD (rev. 1.17, 1.21 by millert)
MFC after:	3 months
2004-10-08 21:15:21 +00:00
Joseph Koshy
6febaa3aff Mutually cross-reference sysexits(3) and err(3). Add text to err(3)
recommending that the standard exit codes in sysexits(3) be used.

Reviewed by:    ru
2004-10-04 14:04:37 +00:00
David Schultz
48c8620ae4 Remove __isnanl() to avoid conflicting with the same function in libm.
__isnan() and __isnanf() must remain in libc for hysterical raisins.
On the other hand, __isnanl() must live in libm because libm uses it
internally and can't depend on older versions of libc to provide it.
Fortunately, we don't need __isnanl() in both libraries.

Prodded by:	ale
PR:		71698
MT5 candidate
2004-09-24 06:33:22 +00:00
Olivier Houchard
9e3a79d517 Arbitraly choose the Variant II for arm. 2004-09-23 23:14:09 +00:00
Tim J. Robbins
b37ff7a592 Septepber -> September
Noticed by:	ru
2004-09-01 23:28:27 +00:00
Tim J. Robbins
e6e1974ba5 Back out the previous change. glob() still does use strcmp() to order
pathnames.
2004-09-01 11:02:55 +00:00
Tim J. Robbins
1fd0f50a3a Add cross-reference to ftw(3). 2004-08-29 06:39:58 +00:00
Tim J. Robbins
e1bcce4f46 Replace the current implementations of ftw() and nftw() with the OpenBSD
implementations written by Todd C. Miller. These are cleaner, less buggy
and actively maintained.
2004-08-24 13:00:55 +00:00
Doug Rabson
bd41e9ea59 Make sure we allocate at least enough space for the TCB for variant I TLS.
MFC after: 3 days
2004-08-23 15:30:05 +00:00
Tim J. Robbins
9777e82e42 Update documentation to match reality: glob() sorts its result according
to the current LC_COLLATE setting, not in "ASCII order".

PR:		54391
MFC after:	1 week
2004-08-23 12:10:44 +00:00
Doug Rabson
0e7e4e5fd6 Always allocate a TLS area even if its empty - libpthread relies on
having a valid %gs when it initialises.

MFC after: 2 days
2004-08-18 10:18:58 +00:00
Doug Rabson
ccd13c49b5 Add support for TLS in statically linked programs. 2004-08-15 16:18:52 +00:00
Stefan Farfeleder
4eae39bfdf Avoid using void pointers in additive expressions.
PR:		56653
2004-08-14 17:46:10 +00:00
Doug Rabson
0e1c7d0f08 Add stubs for TLS functions. These will be replaced at runtime by the
functional versions in rtld.
2004-08-03 08:54:01 +00:00
Stefan Farfeleder
3103c94843 Remove an implicit int parameter by using prototypes. 2004-08-02 08:46:23 +00:00
Stefan Farfeleder
44a35598ff Don't pass function pointers via a void * parameter. 2004-08-02 08:18:43 +00:00
Alexander Kabaev
132cc0756e Use newly added __used attribute to keep static function symbols from being
eliminated by compiler optimizer.
2004-07-29 18:07:08 +00:00
Tim J. Robbins
e9346e012d Add support for multibyte characters. 2004-07-29 03:48:52 +00:00
Tim J. Robbins
9a9aa3ffa1 Add a paragraph break in the STANDARDS section to improve readability. 2004-07-29 03:41:24 +00:00
Tim J. Robbins
9d88e27007 Add support for multibyte characters. 2004-07-29 03:13:10 +00:00
Tim J. Robbins
f825dd29c2 Document incorrect handling of multibyte characters due to limitations
of sh(1).
2004-07-28 15:43:33 +00:00
Dag-Erling Smørgrav
7688459683 ANSIfy and constify; this now builds with GCC 3.4. 2004-07-28 11:56:03 +00:00
Tim J. Robbins
16018100a7 Add an nftw(3) link. 2004-07-25 11:17:54 +00:00
David Schultz
9b5f005228 Remove unused variable.
Noticed by:	Todd Miller <Todd.Miller@courtesan.com>
2004-07-23 06:01:00 +00:00
David Schultz
ec79bc0da9 Fix two bugs in the signbit() macro, which was implemented last year:
- It was added to libc instead of libm.  Hopefully no programs rely
  on this mistake.

- It didn't work properly on large long doubles because its argument
  was converted to type double, resulting in undefined behavior.
2004-07-19 08:16:10 +00:00
David Schultz
39bcea8689 Replace seven nominally MD implementations of frexp() that are broken
for subnormals with one implementation that works.
2004-07-18 21:23:39 +00:00
Tim J. Robbins
ad3d799334 Remove claim of conformance to IEEE Std. 1003.2. Replace it with a list
of features required by the standard that the current implementation
does not support.

PR:	57911 (related)
2004-07-18 10:11:27 +00:00
Tim J. Robbins
613e383e81 Remove claim of conformance to IEEE Std. 1003.2. Replace it with a list
of features required by the standard that the current implementation
does not support.

PR:	57911
2004-07-18 06:56:40 +00:00
Tim J. Robbins
ad19b09bec Fix typo: carat -> caret. 2004-07-17 12:27:25 +00:00
Marcel Moolenaar
f5eda2f1cb Unbreak alpha: On alpha a long double is the same as a double and
consequently the exponent is only 11 bits. Testing whether the
exponent equals 32767 in that case only effects to compiler warnings
and thus build breakage.
2004-07-10 15:52:26 +00:00
David Schultz
ad93428d7a Bump document date for recent changes.
Prodded by:	ru
2004-07-09 06:37:44 +00:00
David Schultz
3bdf026534 Document these functions as being in libm, not libc. Some of them
*are* in libc for historical reasons, but programmers should not rely
on that fact.

Also remove a BUGS section that is not relevant here.
2004-07-09 03:33:00 +00:00
David Schultz
240dbabfa8 Implement the classification macros isfinite(), isinf(), isnan(), and
isnormal() the hard way, rather than relying on fpclassify().  This is
a lose in the sense that we need a total of 12 functions, but it is
necessary for binary compatibility because we have never bumped libm's
major version number.  In particular, isinf(), isnan(), and isnanf()
were BSD libc functions before they were C99 macros, so we can't
reimplement them in terms of fpclassify() without adding a dependency
on libc.so.5.  I have tried to arrange things so that programs that
could be compiled in FreeBSD 4.X will generate the same external
references when compiled in 5.X.  At the same time, the new macros
should remain C99-compliant.

The isinf() and isnan() functions remain in libc for historical
reasons; however, I have moved the functions that implement the macros
isfinite() and isnormal() to libm where they belong.  Moreover,
half a dozen MD versions of isinf() and isnan() have been replaced
with MI versions that work equally well.

Prodded by:	kris
2004-07-09 03:32:40 +00:00
Ruslan Ermilov
1c5f1e7afd Fixed markup. 2004-07-07 20:11:35 +00:00
David Schultz
b03b864ac9 Add implementations of ftw(3) and nftw(3) and the corresponding header
ftw.h.  This is the implementation written by Joel Baker
<fenton@debian.org> for inclusion in NetBSD, but with several
bugfixes.

Obtained from:	Debian
2004-07-05 23:13:16 +00:00
David Schultz
c8f7bbe36b Documentation for ftw(3) and nftw(3).
Obtained from:	OpenBSD
2004-07-05 23:12:11 +00:00
Ruslan Ermilov
51f98e585b Fix the NAME section making whatis(1) happy in particular. 2004-07-05 17:12:53 +00:00
Ruslan Ermilov
30950a21e1 Eliminate double whitespace. 2004-07-03 22:30:10 +00:00
Ruslan Ermilov
1a0a934547 Mechanically kill hard sentence breaks. 2004-07-02 23:52:20 +00:00
Ruslan Ermilov
d37ea99837 Removed trailing whitespace. 2004-07-02 19:07:33 +00:00
Ruslan Ermilov
26b6c45a92 Markup tidying. 2004-07-02 16:45:56 +00:00
Ruslan Ermilov
33992dc0ed Markup, grammar, and spelling fixes. 2004-06-30 20:09:10 +00:00
Tim J. Robbins
b7114d4a9c Fix typo: WRDE_DOOFS -> WRDE_DOOFFS.
Noticed by:	Stoned Elipot
2004-06-30 13:55:08 +00:00
Mike Pritchard
811815574d Spelling fixes. 2004-06-21 19:30:45 +00:00
David Schultz
1e03bff7f2 In fts_build(), if we try to chdir and fail (e.g. due to lack of search
permission), try to continue in FTS_DONTCHDIR mode.  Of course this
won't work for long paths, but we can't descend more than one pathname
component beyond the directory anyway if we lack search permission.

Here is a transcript demonstrating the change, where oldls is ls(1)
linked with the old fts(3):

	das@VARK:~> mkdir t && touch t/{a,b,c} && chmod u-x t
	das@VARK:~> oldls t
	a       b       c
	das@VARK:~> oldls -l t
	das@VARK:~> \ls t
	a       b       c
	das@VARK:~> \ls -l t
	ls: a: Permission denied
	ls: b: Permission denied
	ls: c: Permission denied

I had forgotten about this patch until bde reminded me.  He reports
using it without problems for over a year.

PR:	45723
2004-06-08 06:23:23 +00:00
Yaroslav Tykhiy
35641ec00f Finally document the option to avoid zombie creation
through ignoring SIGCHLD.
2004-06-07 11:01:39 +00:00
Peter Pentchev
c56864a7a7 Fix the ordering in the description of the dlsym() lookup procedure to
reflect src/libexec/rtld-elf/rtld.c rev. 1.68 - the globally-loaded
objects (RTLD_GLOBAL) are searched before the local object's DAG's.

PR:		62770
Submitted by:	Kimura Fuyuki <fuyuki@nigredo.org>
2004-06-03 10:13:26 +00:00
Tim J. Robbins
95a535af6d Change the signature of ftok from (const char *, char) to (const char *, int)
Obtained from:	NetBSD (christos)
2004-06-01 06:53:07 +00:00