Commit Graph

9701 Commits

Author SHA1 Message Date
kientzle
679214057f Start to address the race issue between restoring a file's contents
and restoring the metadata.  In particular, the metadata-restore
functions now all accept a file descriptor and a pathname.  If the
file descriptor is set and the platform supports the appropriate
syscall, restore the metadata through the file descriptor.  Otherwise,
restore it through the pathname.  This is complicated by varying
syscall support (FreeBSD has an fchmod(2) but no fchflags(2), for
example) and because non-file entries don't have an fd to use in
restoring attributes (for example, mknod(2) doesn't return a file
handle).

MFC after: 14 days
2005-05-21 19:45:56 +00:00
kientzle
836810b4ad Correct return values in myopen() and myclose() in Example code.
Bug: docs/79318
Thanks to: Derek Tattersall
MFC after: 7 days
2005-05-21 19:38:19 +00:00
ume
7b79eaa853 reduce strlen() call. 2005-05-20 15:39:20 +00:00
ume
2cde1446c4 use reentrant.h and simplify. 2005-05-20 15:17:08 +00:00
ume
9c3e63767f check return value of ttyname_r(). 2005-05-20 14:59:20 +00:00
ume
46b442f54f ttyname_r() didn't pass correct buffer size to devname_r(). 2005-05-20 14:56:55 +00:00
charnier
2c8da3ed5c Remove unused variables. 2005-05-20 13:09:49 +00:00
charnier
39a9d373e2 Remove unused variable. Shorten the path to WARNS=6 compliance. 2005-05-20 12:55:38 +00:00
charnier
82a3857378 Remove unused variables. Whitespace cleaning. 2005-05-20 12:46:34 +00:00
peter
ccb7bcb270 Fix libstand on amd64. Rev 1.46 (obrien) removed the -I. that the
bzip2 support provided, and amd64 depended on.  Amd64 has a custom
${.OBJDIR}/machine symlink in it and the -I. picked this up.  Without
it, the libstand code was being compiled in 32 bit mode, but with 64 bit
machine headers.
2005-05-20 03:18:19 +00:00
dfr
98e6de9a62 Align the stack to a 16 byte boundary so that we can safely call functions
that use SSE. The compiler does attempt to do this in main() but not very
successfully - it still manages to use unaligned offsets from %ebp in some
cases. Also we need to have an aligned stack in case something uses SSE
via _init().

MFC After: 1 week
2005-05-19 07:36:07 +00:00
dfr
3dc9679905 Keep the stack aligned to a 16 byte boundary when calling init functions
so that we don't cause a bus error if they start storing SSE math stuff
on the stack.

MFC After: 1 week
2005-05-19 07:31:06 +00:00
obrien
bca87b9306 Clean up an additional file. 2005-05-17 17:48:26 +00:00
obrien
5c77bb4195 Don't use a patch w/in /usr/src. Programmatically change files when needed. 2005-05-17 17:46:29 +00:00
obrien
f95df4a3be Re-enable support for bzip2'ed compressed filesystems. 2005-05-17 16:22:54 +00:00
obrien
40b2656757 Temporarily disable support for bzip2'ed compressed filesystems, until a
maintainable why of handling them is created.
2005-05-17 01:44:37 +00:00
ru
f739a22747 Make <runefile.h> internal to libc.
Suggested by:	phantom
2005-05-16 09:32:41 +00:00
ume
0c39f0c882 - 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
gnn
ea7aec906a 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
delphij
ba0617ffa9 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
stefanf
b4818c2746 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
ume
5f92e47483 NI_WITHSCOPEID cleanup
Reviewed by:	des
2005-05-13 20:51:09 +00:00
ume
6ceae5b50c raise readability bit. 2005-05-13 17:56:53 +00:00
ume
dc887c9064 free ypbuf only when yp_match() succeed. 2005-05-13 17:30:03 +00:00
ume
4bc9a39c1e 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
delphij
7e476cb2a4 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
delphij
a81a1bffd0 Connect MLINKS for ttyname_r(3), and add prototype into unistd.h. 2005-05-11 14:07:25 +00:00
delphij
ccf02e4a75 Avoid (unnecessarily) casting away const within uuid_is_nil. 2005-05-11 13:18:10 +00:00
kientzle
d91591a685 Document zlib update procedure and provide future maintainers a
snapshot of the current state of the import.

MFC after:	2 weeks
2005-05-11 03:50:50 +00:00
kientzle
41a3aa0043 Since the FreeBSD local modifications are mostly trivial (consisting
primarily of pointless $FreeBSD$ tags), sync most files in HEAD with
those in the ZLIB branch.  This minimizes the differences between
HEAD and ZLIB and should simplify future imports.

After this, there are only three files with local modifications
(gzio.c, minigzip.c, and zconf.h) and two non-vendor files
(Makefile, zopen.c).  The rest exactly match the vendor distribution.

PR:		i386/76294
MFC after:	2 weeks
2005-05-11 03:47:48 +00:00
kientzle
ad287feacf archive_entry_set_link is supposed to update whichever link field
(symlink or hardlink) is already set.  Instead, it was always setting
the hardlink field.  In particular, this caused GNU tar format long
symlinks to be interpreted as hardlinks.

Thanks to: Brooks Davis
MFC after: 7 days
2005-05-08 19:10:41 +00:00
deischen
eda732bae0 Prevent these functions from using stack outside of their frame.
Reported by:	Marc Olzheim <marcolz at stack dot nl>
OK'd by:	das
2005-05-06 15:44:20 +00:00
davidxu
4db2a8432c 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
glebius
299d591b08 Build userland libalias using src/sys/netinet/libalias.
Reviewed by:	ru
Repocopy by:	peter
2005-05-04 12:49:44 +00:00
keramida
a47f95475e 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
des
66018e049a 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
ume
c1d8e4b1aa 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
delphij
93df2af1e5 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
ume
65860bfedb fix signed/unsigned comparison warnings.
Obtained from:	NetBSD
2005-05-03 16:13:31 +00:00
delphij
f5addd52e2 Include paths.h for prototype of getbootfile(3). 2005-05-03 15:28:07 +00:00
ume
658e187718 the 3rd argument of getsockname() should be socklen_t*.
Submitted by:	stefanf
2005-05-02 04:43:32 +00:00
jkoshy
262fe13148 Add convenience APIs pmc_width() and pmc_capabilities() to -lpmc.
Have pmcstat(8) and pmccontrol(8) use these APIs.

Return PMC class-related constants (PMC widths and capabilities)
with the OP GETCPUINFO call leaving OP PMCINFO to return only the
dynamic information associated with a PMC (i.e., whether enabled,
owner pid, reload count etc.).

Allow pmc_read() (i.e., OPS PMCRW) on active self-attached PMCs to
get upto-date values from hardware since we can guarantee that the
hardware is running the correct PMC at the time of the call.

Bug fixes:
 - (x86 class processors) Fix a bug that prevented an RDPMC
   instruction from being recognized as permitted till after the
   attached process had context switched out and back in again after
   a pmc_start() call.

   Tighten the rules for using RDPMC class instructions: a GETMSR
   OP is now allowed only after an OP ATTACH has been done by the
   PMC's owner to itself.  OP GETMSR is not allowed for PMCs that
   track descendants, for PMCs attached to processes other than
   their owner processes.

 - (P4/HTT processors only) Fix a bug that caused the MI and MD
   layers to get out of sync.  Add a new MD operation 'get_config()'
   as part of this fix.

 - Allow multiple system-mode PMCs at the same row-index but on
   different CPUs to be allocated.

 - Reject allocation of an administratively disabled PMC.

Misc. code cleanups and refactoring.  Improve a few comments.
2005-05-01 14:11:49 +00:00
ume
6edfe7b563 oops, we don't need previous change. 2005-05-01 12:37:12 +00:00
ume
cd238cdb0c make it compilable without YP definition. 2005-05-01 12:08:57 +00:00
ume
f2cd3c4522 don't see RES_USE_INET6 when called from getipnodeby*(). 2005-05-01 07:39:45 +00:00
ume
98aaf9122a 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
ume
2a7fd02aa3 handling RES_USE_INET6 better. 2005-04-30 19:28:31 +00:00
ume
e2c3e9cc42 _ht_gethostbyaddr didn't handle RES_USE_INET6 correctly. 2005-04-30 18:46:27 +00:00
ume
048aaedcb4 _gethostbynisname() didn't support RES_USE_INET6. 2005-04-30 18:37:35 +00:00
ume
2621c37e55 _ht_gethostbyname didn't handle RES_USE_INET6 correctly. 2005-04-30 17:01:18 +00:00