Commit graph

5036 commits

Author SHA1 Message Date
Daniel Eischen ed0b0abcf7 Make syslog() use the internal (non-cancellation point) _usleep().
Prior to this it was calling the cancellable usleep() while holding
a lock.
2005-08-03 00:45:58 +00:00
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
Daniel Eischen 78956f2474 Add namespace #defines for usleep. 2005-08-03 00:43:14 +00:00
Giorgos Keramidas 6fb9b618f5 Fix all the spelling mistakes I could find in the man pages for words
that have at least 3 characters.

MFC after:	1 week
Thanks to:	Music band ``Chingon''
		for keeping me company while searching for these.
2005-07-31 03:30:48 +00:00
Diomidis Spinellis 87a236caf5 Document the ECONNRESET errno value. 2005-07-29 07:42:10 +00:00
Hajimu UMEMOTO 5495564735 don't accept invalid form of an address like 1:2:3:4:5:6:7::8.
PR:		bin/84106
Obtained from:	BIND9
MFC after:	2 days
2005-07-27 14:33:36 +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
Tim J. Robbins d48c77b534 Speed up __wcsconv() (and hence the printf() %ls format):
- use wcsrtombs() instead of a wcrtomb() loop where possible.
- avoid wcrtomb() loop when output precision is small.
2005-07-24 12:12:44 +00:00
Pawel Jakub Dawidek 9975a9a287 Better translation. 2005-07-23 21:30:35 +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
Hajimu UMEMOTO 85a71a15c8 Remove padding for ABI compatibility of ai_addrlen member
from struct addrinfo.  This change break ABI compatibility
on 64 bit arch.
2005-07-22 18:21:28 +00:00
Tim J. Robbins d2a57b3026 Add HISTORY section. 2005-07-21 10:53:27 +00:00
Tim J. Robbins 9376b9d71a Add cross-reference to nextwctype(3). 2005-07-21 10:32:17 +00:00
Tim J. Robbins 5a94ee1180 Add COMPATIBILITY and HISTORY sections. Fix typo. 2005-07-21 10:27:45 +00:00
Hajimu UMEMOTO d84e21303c refer RFC 3542 rather than RFC 2292bis.
Submitted by:	Keiichi SHIMA <keiichi__at__iijlab.net>
Obtained from:	KAME
2005-07-19 18:13:58 +00:00
Hajimu UMEMOTO d5cbe1abb0 fixed the validation code of routing header length in inet6_rth_getaddr().
reported by Delia Kecskemeti <delia.kecskemeti__at__windriver.com>

Submitted by:	Keiichi SHIMA <keiichi__at__iijlab.net>
Obtained from:	KAME
2005-07-19 18:09:44 +00:00
John-Mark Gurney 5ba593de9e remove the supposed max of 2^31, it hasn't been this small in a very
long time... i.e. since this file was imported...  (ufs1 supports much
larger files then this)...

Submitted by:	Ivan Voras
MFC after:	1 week
2005-07-18 22:27:41 +00:00
Tim J. Robbins a385e04b47 Remove confusing "single C char locales" phrase; arguments to these
functions and must now be either an unsigned char or EOF, regardless of
locale.
2005-07-17 04:11:06 +00:00
Tim J. Robbins 5b86168f54 Remove confusing "single C char locales" phrase; arguments to tolower()
and toupper() must now be either an unsigned char or EOF, regardless of
locale.
2005-07-17 03:37:00 +00:00
Jung-uk Kim a0f887f4f3 Use better Korean translation for `trap'
Requested by:	many Korean users from bsdforum.or.kr
Submitted by:	perky
Approved by:	anholt (mentor)
2005-07-16 05:40:14 +00:00
Maxim Sobolev 9c007cf29e Document the fact that if MAP_FIXED request has been successful it
replaces any previous mapping to the same address.

Obtained from:	IEEE Std 1003.1, 2004 Edition
2005-07-15 11:37:25 +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
John Baldwin bcd9e0dd20 - Add two new system calls: preadv() and pwritev() which are like readv()
and writev() except that they take an additional offset argument and do
  not change the current file position.  In SAT speak:
  preadv:readv::pread:read and pwritev:writev::pwrite:write.
- Try to reduce code duplication some by merging most of the old
  kern_foov() and dofilefoo() functions into new dofilefoo() functions
  that are called by kern_foov() and kern_pfoov().  The non-v functions
  now all generate a simple uio on the stack from the passed in arguments
  and then call kern_foov().  For example, read() now just builds a uio and
  calls kern_readv() and pwrite() just builds a uio and calls kern_pwritev().

PR:		kern/80362
Submitted by:	Marc Olzheim marcolz at stack dot nl (1)
Approved by:	re (scottl)
MFC after:	1 week
2005-07-07 18:17:55 +00:00
Joe Marcus Clarke a617a18a23 Fix ptsname(3) by converting it to use devname(3) to obtain the name of
a tty device instead of the legacy minor number approach.  This is known to
fix gnome-vfs' sftp module as well as kio_sftp and kdesu on -CURRENT.

Thanks to scottl for the snprintf() approach idea.

Reviewed by:	phk
Tested by:	pav
		mich
Approved by:	re (scottl)
2005-07-07 17:48:40 +00:00
Xin LI 1c70a91b10 Minor grammar fix
Submitted by:	Wojciech A. Koszek [dunstan at freebsd czest pl]
Approved by:	re (hrs)
2005-07-03 12:35:11 +00:00
Hiten Pandya a1601503f5 Use 'manual page' instead of 'man page' for consistency.
Approved by:	re (hrs)
2005-06-30 13:18:15 +00:00
Peter Wemm 3b4399f6a7 Clean out the leftovers from the i386_set_gsbase() TLS conversion.
Like on libthr, there is an i386_set_gsbase() stub implementation here
to avoid libc.so.5 issues.  This should likely be a weak symbol and I
expect this will be fixed soon.

Approved by:	re
2005-06-29 23:15:36 +00:00
Stefan Farfeleder 882cf65dd6 Add the functions _Qp_cmp() and _Qp_cmpe() as described in the Sparc
Compliance Definition.  On sparc64, GCC emits _Qp_cmp() calls for its
__builtin_isfoo() functions which are used for C99's isfoo() macros.

Approved by:	re(dwhite)
PR:		73782
2005-06-21 21:13:07 +00:00
Ruslan Ermilov 48856b0042 Markup fixes.
Approved by:	re
2005-06-16 19:01:07 +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
Jacques Vidrine a8e0b2e8ab Remove rexecd(8), a server that implements a particularly insecure
method of executing commands remotely.  There are no rexec clients in
the FreeBSD tree, and the client function rexec(3) is present only in
libcompat.  It has been documented as "obsolete" since 4.3BSD, and its
use has been discouraged in the man page for over 10 years.
2005-06-10 20:52:36 +00:00
Craig Rodrigues e5d54f7733 Fix the wording in this man page so that it
reflects the actual behavior of the API
for listing extended attributes.

PR:		docs/79261
Submitted by:	rodrigc
Reviewed by:	rwatson, kan
Approved by:	das (mentor)
2005-06-10 16:54:17 +00:00
Alan Cox 2ca32bcc02 Update .Dd value. 2005-06-04 19:44:09 +00:00
Alan Cox bbe7bbdfee Eliminate the original method of requesting notification of aio_read(2) and
aio_write(2) completion through kevent(2).  This method does not work on
64-bit architectures.  It was deprecated in FreeBSD 4.4.  See revisions
1.87 and 1.70.2.7.

Change aio_physwakeup() to call psignal(9) directly rather than indirectly
through a timeout(9).  Discussed with: bde

Correct a bug introduced in revision 1.65 that could result in premature
delivery of a signal if an lio_listio(2) consisted of a mixture of
direct/raw and queued I/O operations.  Observed by: tegge

Eliminate a field from struct kaioinfo that is now unused.

Reviewed by: tegge
2005-06-04 19:16:33 +00:00
Warner Losh 46813f9674 Missed rwatson's redundancy 2005-06-03 15:50:55 +00:00
Hajimu UMEMOTO 360a23ab31 reflect type change of n_net and getnetbyaddr(3). 2005-06-03 04:44:54 +00:00
Hajimu UMEMOTO ad0fab44e2 - Remove padding for ABI compatibility of n_net member from struct
netent.
- Change 1st argument of getnetbyaddr() to an uint32_t on 64 bit
  arch as well to confirm to POSIX-2001.

These changes break ABI compatibility on 64 bit arch.
There is similar padding issue for ai_addrlen of struct addrinfo.
However, it is leaved as is for now.

Discussed on:	arch@, standards@ and current@
X-MFC after:	never
2005-06-03 03:32:06 +00:00
Hajimu UMEMOTO d6fd3ed8ab reduce cast.
MFC after:	1 week
2005-05-27 20:44:57 +00:00
Stefan Farfeleder 1470d46611 Fix long (and long long) to long double, unsigned to long double and unsigned
long (and unsigned long long) to long double conversions.
- Add a parameter that specifies the position of the sign bit to the _QP_TTOQ
  macro, previously it always looked at bit 31.  Pass a negative number to
  disable sign inspection for unsigned types.  This fixes _Qp_xtoq(),
  _Qp_uitoq() and _Qp_uxtoq().
- In the functions __fpu_itof() and __fpu_xtof(), look at the sign bit to
  decide whether we're doing a conversion from an unsigned type.  If so, don't
  negate the mantissa if the integer exceeds the biggest signed number.

PR:		55773
Patch by:	Stephen Paskaluk (based upon)
MFC after:	2 weeks
2005-05-27 10:00:22 +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
Ruslan Ermilov 228f8c4f8b Make <runefile.h> internal to libc.
Suggested by:	phantom
2005-05-16 09:32:41 +00:00
Hajimu UMEMOTO 036ae3dd79 - The ai_addrlen of a struct addrinfo used to be a size_t, per
RFC 2553.  In XNS5.2, and subsequently in POSIX-2001 and RFC
  3493, it was changed to a socklen_t.  And, the n_net of a
  struct netent used to be an unsigned long integer.  In XNS5,
  and subsequently in POSIX-2001, it was changed to an uint32_t.
  To accomodate for this while preserving ABI compatibility with
  the old interface, we need to prepend or append 32 bits of
  padding, depending on the (LP64) architecture's endianness.
- Correct 1st argument of getnetbyaddr() to uint32_t on 32
  bit arch.  Stay as is on 64 bit arch for ABI backward
  compatibility for now.

Reviewed by:	das, peter
MFC after:	2 weeks
2005-05-15 20:15:15 +00:00
George V. Neville-Neil fd57e549e0 Submitted by: Jinmei Tatuya, Hajimu Umemoto
Reviewed by:	rwatson at freebsd dot org
Approved by:	rwatson at freebsd dot org
MFC after:	1 week

Fix the matchlen() function so that it handles the IPv4 (AF_INET)
case correctly.  Until now it has been treating IPv4 addresses
as if they were IPv6 which could lead to corruption errors.
2005-05-14 19:43:10 +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
Stefan Farfeleder c29f424e01 The header glue.h should provide just a declaration for the variable
__sglue, not a definition.

PR:		80378
Submitted by:	John Engelhart <johne@zang.com>
MFC after:	1 week
2005-05-13 21:12:34 +00:00
Hajimu UMEMOTO 946e41f142 raise readability bit. 2005-05-13 17:56:53 +00:00
Hajimu UMEMOTO f8997ca2f4 free ypbuf only when yp_match() succeed. 2005-05-13 17:30:03 +00:00
Hajimu UMEMOTO 4f10131848 NI_WITHSCOPEID cleanup. Neither RFC 2553 nor RFC 3493 defines
NI_WITHSCOPEID, and our getaddrinfo(3) does nothing special
for it, now.
2005-05-13 16:31:11 +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 f57a875fa0 Avoid (unnecessarily) casting away const within uuid_is_nil. 2005-05-11 13:18:10 +00:00
David Xu 0fa2f94316 Fix race by using atomic operation, with this change, both libpthread
and libthr now can run profiling on SMP.
2005-05-06 07:37:01 +00:00
Giorgos Keramidas e3446e1f8e Document the fact that accept(2) may return EINVAL when addrlen is
negative (in addition to returning EINVAL when called on a descriptor
that is not a socket).

Submitted by:	Arne H Juul <arnej@europe.yahoo-inc.com>
PR:		docs/80587
2005-05-04 11:09:26 +00:00
Dag-Erling Smørgrav bc8695dc6c The correct description for mode "w" is
(((truncate to zero length) or (create)) (text file)) (for writing)
and not
  ((truncate file to zero length) or (create text file)) (for writing)

MFC after:	1 week
2005-05-04 08:12:44 +00:00
Hajimu UMEMOTO d21de89a71 do mutex lock for each yp calls. with this,
http://cvsweb.netbsd.org/bsdweb.cgi/src/regress/lib/libpthread/resolv/
is working.
2005-05-03 20:30:31 +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
Hajimu UMEMOTO 1ccfa322aa fix signed/unsigned comparison warnings.
Obtained from:	NetBSD
2005-05-03 16:13:31 +00:00
Xin LI 2f22da5d97 Include paths.h for prototype of getbootfile(3). 2005-05-03 15:28:07 +00:00
Hajimu UMEMOTO 943db5a2ab the 3rd argument of getsockname() should be socklen_t*.
Submitted by:	stefanf
2005-05-02 04:43:32 +00:00
Hajimu UMEMOTO f468e837a1 oops, we don't need previous change. 2005-05-01 12:37:12 +00:00
Hajimu UMEMOTO 6bd1d1a192 make it compilable without YP definition. 2005-05-01 12:08:57 +00:00
Hajimu UMEMOTO 8592d23a9f don't see RES_USE_INET6 when called from getipnodeby*(). 2005-05-01 07:39:45 +00:00
Hajimu UMEMOTO e84892eb74 oops, gethostbyaddr(3) must return h_addr as an IPv4-mapped
IPv6 address when RES_USE_INET6 was set, according to RFC 2133
section 6.2.
2005-04-30 20:07:01 +00:00
Hajimu UMEMOTO 6964622dd0 handling RES_USE_INET6 better. 2005-04-30 19:28:31 +00:00
Hajimu UMEMOTO e4f846efec _ht_gethostbyaddr didn't handle RES_USE_INET6 correctly. 2005-04-30 18:46:27 +00:00
Hajimu UMEMOTO e692b6186a _gethostbynisname() didn't support RES_USE_INET6. 2005-04-30 18:37:35 +00:00
Hajimu UMEMOTO 40ca152d15 _ht_gethostbyname didn't handle RES_USE_INET6 correctly. 2005-04-30 17:01:18 +00:00
Hajimu UMEMOTO 2c08ac2b38 - do validation check and IPv4-mapped IPv6 address handling before
any query.
- don't query against IPv6 link-local address.
- use IN6_IS_ADDR_V4{MAPPED,COMPAT} macros.
- use memcpy() instead of bcopy().

Inspired by:	NetBSD
2005-04-29 19:55:23 +00:00
Hajimu UMEMOTO 86726f325b NETDB_INTERNAL is not fit, here. return NO_RECOVERY for h_errno. 2005-04-29 17:36:54 +00:00
Hajimu UMEMOTO 49e0283df8 our get{addr,name}info() is considered thread-safe. 2005-04-29 14:37:51 +00:00
Hajimu UMEMOTO 0d389e7212 we cannot use inet_ntoa(3), here. so, use inet_ntop(3), instead. 2005-04-29 12:01:36 +00:00
Hajimu UMEMOTO 850bc9af6b sync _map_v4v6_host*() with bind9's. it treats align better bit.
Obtained from:	BIND9
2005-04-28 18:52:40 +00:00
Hajimu UMEMOTO b8ab0f4506 we don't need mutex lock to call _gethostbynis*(), anymore. 2005-04-28 18:21:11 +00:00
Hajimu UMEMOTO aa2f4ec72a make gethostby*() thread-safe. 2005-04-28 18:03:43 +00:00
Hajimu UMEMOTO 7b671d902b _gethostbynis{addr,name}() can handle an IPv6, now. 2005-04-28 17:44:44 +00:00
Hajimu UMEMOTO a2a775011c make getnetby*() thread-safe. 2005-04-28 15:32:55 +00:00
Hajimu UMEMOTO bcb131aa3c hide implementation specific internal functions from netdb.h.
it is needed to make get{host,net}by*() thread-safe.
2005-04-27 19:12:57 +00:00
Peter Wemm 3bbf3512ad Provide stub functions for i386_set_ldt() and i386_get_ldt() even when
compiling as an amd64 support binary.  They will return EINVAL on an amd64
kernel, but this simplifies other #ifdefs that were getting a bit nasty.
2005-04-26 20:51:15 +00:00
Peter Wemm 8fa4081fe3 No longer use _amd64_set_gsbase(). Use i386_set_gsbase() even when
building for amd64.
2005-04-26 20:46:11 +00:00
Hajimu UMEMOTO b190ee6140 our get{proto,serv}by*() use a thread-specific data space. 2005-04-26 18:04:09 +00:00
Hajimu UMEMOTO 72572cc6ea add IPv6 awareness for NIS query of gethostby*().
Inspired by:	NetBSD
2005-04-26 14:55:47 +00:00
Hajimu UMEMOTO a72b0131c9 ensure parsing numeric address before any host query.
Inspired by:	NetBSD
2005-04-25 17:36:28 +00:00
Hajimu UMEMOTO 4801b1f131 remove unused variable. 2005-04-25 14:52:13 +00:00
Xin LI b49627d7a7 Remove unused file.
Confirmed by:	tjr [1]

[1] PERFORCE CHANGESET 57044:
	http://perforce.freebsd.org/changeView.cgi?CH=57044
2005-04-25 02:29:03 +00:00
Hajimu UMEMOTO 71d0cbb671 if last line didn't have trailing space, network address was also
treated as an alias.
2005-04-24 18:22:39 +00:00
Alan Cox 97cd6892ba Optimize the instruction alignment. 2005-04-23 18:45:36 +00:00
Alan Cox c0862430d5 Eliminate an unpredictable branch from bcmp().
Reviewed by: bde
2005-04-21 23:07:20 +00:00
Alexander Kabaev f2da7e0e49 Do not try to store 64 bits into 32 bit errno variable. With the changed libc
data layout, this was corrupting _PathLocale variable leading to programs
dumping core in non-default locales.
2005-04-21 12:47:08 +00:00
Hajimu UMEMOTO 92b6f7be5a - add getproto{byname,bynumber,ent}_r for internal use within libc.
- make getproto{byname,bynumber,ent} thread-safe.
2005-04-19 14:41:13 +00:00
Hajimu UMEMOTO d7d66e8c85 - nuke deprecated and unused getnodeby(3).
- remove unused variable.

Obtained from:	KAME
2005-04-19 12:28:17 +00:00
Hajimu UMEMOTO a87b3988c9 rename the NIS related fields to have yp_ prefix.
Suggested by:	delphij
2005-04-18 18:34:58 +00:00
Xin LI ffe49790ef Do not check whether a pointer is NULL, since free(3) already takes care of
this case.

Reviewed by:	ume
2005-04-18 03:45:23 +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
Xin LI 6d44c5c74b Fix build for !YP case.
BTW.  Shall we change these fields to have yp_ prefix?  That will make the
code easier to read.
2005-04-17 15:10:30 +00:00
Hajimu UMEMOTO 109e5709c0 libc-internal interfaces should have two underscores in front
of their names.

Pointed out by:	das
2005-04-17 14:42:52 +00:00
Xin LI 5c83bb4912 Wrong working directory, sorry. The previous patch was what I have
seen in NetBSD's tree, and this one is what I have submitted for review.

Pointy hat to:	me
2005-04-17 04:00:55 +00:00