Commit Graph

10744 Commits

Author SHA1 Message Date
Pawel Jakub Dawidek
b8f5525f70 The 'name1' argument to symlink(2) is only limited to 1023 characters,
its components are not checked.
2006-12-12 19:48:15 +00:00
Pawel Jakub Dawidek
1212ac8123 mkdir(2) creates directory, not file. 2006-12-12 15:00:08 +00:00
Julian Elischer
558c08c358 Remove reference to confusing behaviour just removed from
the kse_exit() syscall. Describe the correct behaviour.
2006-12-12 08:13:02 +00:00
David Xu
9e8a8aa551 Correctly check failed syscall. 2006-12-12 05:26:39 +00:00
David Xu
347126a2e2 Move checking for c_has_waiters into low level _thr_ucond_signal and
_thr_ucond_broadcast, clear condition variable pointer in cancellation
info after returing from _thr_ucond_wait, since kernel has already
dropped the internal lock, so we don't need to unlock it in cancellation
handler again.
2006-12-12 03:08:49 +00:00
Joseph Koshy
61e1aeb6ee Document the ELF types supported by libelf.
Document the relationship between section types (SHT_*) and the
types known to the libelf.
2006-12-11 09:03:27 +00:00
Pawel Jakub Dawidek
ba4b9e0121 When directory is given as an argument for unlink(2), EPERM is returned
not matter if this is regular directory or a mount point.
2006-12-10 13:04:36 +00:00
Doug Barton
b02f06c3da Changes to generated files related to the 9.3.3 import. 2006-12-10 07:11:04 +00:00
Pawel Jakub Dawidek
e799094d84 If the named file has its immutable or append-only flag set, utimes(2)
returns EPERM.
2006-12-09 23:13:05 +00:00
Pawel Jakub Dawidek
b10ec4d0dc If the parent directory of the named file has its immutable flag set,
mkfifo(2) returns EPERM.
2006-12-09 23:06:01 +00:00
Pawel Jakub Dawidek
2f51879266 If the parent directory of the destination file has its immutable flag set,
symlink(2) returns EPERM.
2006-12-09 23:01:38 +00:00
Pawel Jakub Dawidek
46db118b7e - If the source file has its immutable or append-only flag set, link(2)
returns EPERM.
- If the parent directory of the destination file has its immutable flag set,
  link(2) returns EPERM.
2006-12-09 22:56:40 +00:00
Pawel Jakub Dawidek
9becb00c0a If the named file has its immutable or append-only flag set, truncate(2)
and ftruncate(2) return EPERM.

Note, that if the append-only flag is set even increasing size of the file
is not permitted.
2006-12-09 22:49:28 +00:00
Pawel Jakub Dawidek
442cc490fd If the named file has its immutable flag set, chown(2) returns EPERM. 2006-12-09 22:41:26 +00:00
Pawel Jakub Dawidek
54ec563e0d If the named file has its immutable flag set, chmod(2) returns EPERM. 2006-12-09 22:41:01 +00:00
Pawel Jakub Dawidek
4e3f043c22 Add reference to chflags(2). 2006-12-09 22:39:28 +00:00
Pawel Jakub Dawidek
93dbfff0f9 If the parent directory of the named file has its immutable flag set,
mkdir(2) returns EPERM.
2006-12-09 22:35:55 +00:00
Pawel Jakub Dawidek
3e6f3ff080 - If the directory to be removed has its immutable, undeletable or append-only
flag set, rmdir(2) returns EPERM.
- If the parent directory of the directory to be removed has its immutable or
  append-only flag set, rmdir(2) returns EPERM.
2006-12-09 19:44:38 +00:00
Pawel Jakub Dawidek
b7715d3d86 - If the parent directory of the file pointed at by the from argument has its
immutable or append-only flag set, rename(2) returns EPERM.
- If the parent directory of the file pointed at by the to argument has its
  immutable flag set, rename(2) returns EPERM.
2006-12-09 19:42:58 +00:00
Pawel Jakub Dawidek
483a0e04d8 Correct last commit. The parent directory of the file to be removed can
have undeletable flag set.
2006-12-09 19:40:24 +00:00
Pawel Jakub Dawidek
d1eb7b96e7 When immutable, undeletable or append-only flag is set, rename(2)
return EPERM.
2006-12-09 19:19:46 +00:00
Pawel Jakub Dawidek
858e6c9cbd When undeletable flag is set, unlink(2) return EPERM. 2006-12-09 19:18:39 +00:00
Joseph Koshy
37ec86bb1b Make the generated message from `elf_errmsg(-1)' a little more readable. 2006-12-09 16:27:15 +00:00
Tim Kientzle
0a4794d3a4 Minor refactoring; move the FreeBSD-specific config info into
config_freebsd.h.  archive_platform.h decides which config file
to bring in and uses some of those selectors to define wrapper
macros and other compatibility glue.
2006-12-08 06:13:49 +00:00
Julian Elischer
2d2f0b92c7 remove already commented out code 2006-12-06 06:44:20 +00:00
David Xu
b774466b61 test cancel_pending to save a thr_wake call in some specical cases. 2006-12-06 00:15:35 +00:00
David Xu
a8a343d2e6 _thr_ucond_wait drops lock, we should pick it up again. 2006-12-05 23:46:11 +00:00
David Xu
3b8a017442 the c_has_waiters is lazily updated, temporarily disable the false
alarm code.
2006-12-05 07:23:58 +00:00
David Xu
4d617f2d10 Use ucond to implement barrier. 2006-12-05 06:54:25 +00:00
David Xu
670b44d65a Add _thr_ucond_init(). 2006-12-05 06:53:44 +00:00
David Xu
3ce4e91d4e Tweak _thr_cancel_leave_defer a bit to fix a possible race. 2006-12-05 05:01:57 +00:00
Ruslan Ermilov
a82e937c0b Grammar.
OK'ed by:	sam
2006-12-04 20:34:25 +00:00
Sam Leffler
78e3a7fdd5 document recent change to return ECONNRESET for tcp sockets
MFC after:	1 month
2006-12-04 18:39:11 +00:00
Hajimu UMEMOTO
909e7467d8 Use _kevent() instead of kevent().
Requested by:	nork
2006-12-04 17:08:43 +00:00
David Xu
3c61d00ab6 Fix typo, I was using a wrong header file, and the typo is not detected
by compiler.
2006-12-04 14:27:42 +00:00
David Xu
2bd2c90703 Use kernel provided userspace condition variable to implement pthread
condition variable.
2006-12-04 14:20:41 +00:00
Tim Kientzle
5af1711729 Argh. Restore a stat() call that was erroneously removed.
Thanks to: WATANABE, Kazuo
Pointy hat: me, from the handy dispenser I keep nearby.
2006-12-04 08:01:53 +00:00
Diomidis Spinellis
aeecffebe5 Minor clarification. 2006-12-03 19:26:17 +00:00
Maxim Konovalov
88ce725781 o As POSIX requires confstr(3) returns zero on errors, not -1.
PR:		misc/106234
Submitted by:	Guy Harris
MFC after:	1 week
2006-12-03 08:22:36 +00:00
David Xu
6f54e82927 If a thread was detached, return EINVAL instead, the error code
is also returned by pthread_detach() if a thread was already
detached, the error code was already documented:

>    [EINVAL]	The implementation has detected that the value speci-
>		fied by thread does not refer to a joinable thread.
2006-11-28 11:05:31 +00:00
Tim Kientzle
a6fac34b43 Improve support for large ISOs:
* Correct a signed/unsigned problem that broke handling of files >2G.
   * Implement "skip" support for much faster "tar -t".

Thanks to: Robert Sciuk for sending me a DVD that illustrated the first problem
2006-11-27 16:30:32 +00:00
Tim Kientzle
24d698ea89 Bump the libarchive version number, correct the shell hackery to break
the full version down into major/minor values.
2006-11-26 19:09:42 +00:00
Tim Kientzle
dc46be1cbf Write-blocking cleanup, largely thanks to Colin Percival (cperciva@).
* If write block size is zero, don't block at all.
     This supports the unusual requirement of applications
     that need "no-delay" writes.
   * Expose _write_finish_entry() to give such applications more
     control over write boundaries.  (Normal applications do not
     need this, as entries are completed automatically.)
   * Correct the type of write callbacks; this is a minor API
     change that does not affect the ABI.
   * Correct the error handling in _write_next_header() around
     completing the previous entry.
   * Correct the documentation for block-size markers:  Remove
     docs for the long-defunct _read_set_block_size(); document
     all of the write block size manipulators.

MFC after: 14 days
2006-11-26 19:00:50 +00:00
Ruslan Ermilov
8af480aec1 - When building world WITHOUT_LIBPTHREAD, link libthr to libpthread.
- Don't build ngctl(8) and cached(8) if threading libs aren't built.
- Fix various issues in a cached(8) makefile.
2006-11-26 14:36:34 +00:00
Tim Kientzle
43baed1581 Unbreak libarchive on arm. Two parts of libarchive relied on a
traditional shortcut of defining on-disk layouts using structures of
character arrays. Unfortunately, as recently discussed on cvs-all@,
this usage is not actually sanctioned by the standards and
specifically fails on GCC/arm (unless your data structures happen to
be "naturally aligned").

The new code defines offsets/sizes for data fields and accesses
them using explicit pointer arithmetic, instead of casting to
a structure and accessing structure fields.  In particular,
the new code is now clean with WARNS=6 on arm.

MFC after: 14 days
2006-11-26 05:39:28 +00:00
Tim Kientzle
97fc4d2db7 Connect four new files to the build.
PR: bin/86742
2006-11-24 16:35:54 +00:00
Yaroslav Tykhiy
df19774d2f Note that, thanks to the work by Alan Cox et al, some arch'es
don't need sendfile() buffers any more.

The report on the work referenced can be found at
http://usenix.org/events/usenix05/tech/general/elmeleegy.html

MFC after:	1 week
2006-11-24 11:44:19 +00:00
David Xu
f08e1bf682 Eliminate atomic operations in thread cancellation functions, it should
reduce overheads of cancellation points.
2006-11-24 09:57:38 +00:00
Ruslan Ermilov
73eee24650 - style: use =' instead of +=' for initial assignments.
- don't add generated sources' objects to OBJS explicitly;
  GENSRCS is part of SRCS so they were already in OBJS.
2006-11-24 06:38:11 +00:00
Tim Kientzle
6770b130f1 Fill in a couple of missing casts: clarify one narrowing conversion
and correct the use of unary minus with an unsigned value.  (The unary
minus here is actually being used as a bitwise operation, which is
unusual enough to deserve a clarifying cast.)
2006-11-24 05:48:04 +00:00
Tim Kientzle
4f27e91611 A few minor clarifications and corrections. 2006-11-24 05:41:16 +00:00
Tim Kientzle
b4e244d1a3 A few minor corrections to the libarchive.3 overview page. 2006-11-24 05:37:38 +00:00
Tim Kientzle
73a2505465 Document the new _open_FILE() and _open_memory() interfaces.
PR: bin/86742
2006-11-24 05:34:23 +00:00
Tim Kientzle
13e2d5bcd5 New hooks for reading/writing archives to/from a FILE * or
an in-memory buffer.

PR: bin/86742
2006-11-24 02:00:48 +00:00
John Baldwin
8cc7b0f93d Document that the data field for NOTE_EXIT holds the process exit status.
Submitted by:	Jared Yanovich -phirerunner at comcast.net-
MFC after:	2 weeks
2006-11-20 22:20:04 +00:00
Tim Kientzle
af6513d3ea Officially rename archive_{read,write}_open_file() to
archive_{read,write}_open_filename():
   * Update Makefile to build the files using the new name.
   * Update docs to document the new names, mentioning the
old ones as "deprecated synonyms."
   * The old filenames will be reconnected to the build soon;
I'll soon recyce those files for a slightly different purpose.
2006-11-20 16:48:04 +00:00
Tim Kientzle
5468bdb0da Add archive_write_open_filename()/archive_read_open_filename() as
synonyms for archive_write_open_file()/archive_read_open_file().
The new names are much clearer.
2006-11-15 05:33:38 +00:00
Tim Kientzle
38c56af195 Style: Use the correct type for a sizeof() variable. 2006-11-15 05:20:14 +00:00
Tim Kientzle
ca743d5c67 Change the internal API for writing data to an entry; make the
internal format-specific functions return the same as the public
function, so that the public API layer doesn't have to guess the
correct return value.  This addresses an obscure problem that occurs
when someone tries to write more data than the size of the entry (as
indicated in the entry header).  In this case, the return value from
archive_write_data() was incorrect, reflecting the requested write
rather than the amount actually written.

MFC after: 15 days
2006-11-15 05:14:20 +00:00
Tim Kientzle
fb1856eabd No change in functionality, but fill in a missing error
message when reading a truncated tar archive.
2006-11-13 16:50:18 +00:00
Ruslan Ermilov
cd9e086e93 Fix minor formatting issues:
- make document title match filename;
- remove hard sentence breaks, whitespace at EOL, and double whitespace;
- sort SEE ALSO xrefs, adding missing section numbers;
- fix a misspelled macro name.
2006-11-13 09:46:16 +00:00
Tim Kientzle
71f3ec709d These files no longer use internal APIs, so no longer need to include
archive_private.h.
2006-11-13 00:29:57 +00:00
Tim Kientzle
b2ba9b4e04 Minor cleanup of the standard read/write I/O modules:
* Use public API, don't access struct archive directly.  (People should be able to copy these into their applications as a template for custom I/O callbacks.)
 * Set "skip" only for regular files.  ("skip" allows the low-level library to catch attempts to add an archive to itself or extract over itself.)
 * Simplify the write_open functions by just calling stat() at the beginning.  Somehow, these functions had acquired some complex logic that tried to avoid the stat() call but never succeeded.

MFC after: 10 days
2006-11-13 00:26:45 +00:00
Tim Kientzle
c3b11d8213 Correctly handle writing very large blocks (>1M) through to a disk
file.  This doesn't happen in normal use, because the file I/O and
decompression layers only pass through smaller blocks.  It can happen
with custom read functions that block I/O in larger blocks.
2006-11-12 23:45:40 +00:00
Joseph Koshy
9167cd6392 - Replace the use of DPSRCS with something more appropriate. DPSRCS
is for when you need something in ".depend", but not compiled in.
- Style fixes: Spell ${.OBJDIR} as ".".
- Neaten a comment.

Submitted by:	ru
2006-11-12 18:43:25 +00:00
Joseph Koshy
3eb1a62e69 MFP4: Add an implementation of the ELF(3) and GELF(3) API set.
Bump __FreeBSD_version.

Reviewed by:	jb
2006-11-11 17:16:35 +00:00
David Xu
58c7bab332 Move code calculating new inherited priority into single function. 2006-11-11 13:33:47 +00:00
Dag-Erling Smørgrav
1cede0c9bd childerr needs to be volatile so gcc won't optimize it away.
PR:		bin/85830
MFC after:	1 week
2006-11-10 23:33:25 +00:00
Tim Kientzle
aa1eeda578 Portability and style fixes:
* Actually use the HAVE_<header>_H macros to conditionally include
    system headers.  They've been defined for a long time, but only
    used in a few places.  Now they're used pretty consistently
    throughout.
  * Fill in a lot of missing casts for conversions from void*.
    Although Standard C doesn't require this, some people have been
    trying to use C++ compilers with this code, and they do require it.

Bit-for-bit, the compiled object files are identical, except for
one assert() whose line number changed, so I'm pretty confident I
didn't break anything.  ;-)
2006-11-10 06:39:46 +00:00
Tom Rhodes
c74824fe88 Add an entry for PT_GETLWPLIST.
Nudged by:	jhb
Reviewed by:	davidxu
2006-11-09 11:27:18 +00:00
Olivier Houchard
c0b6c4a212 Cleanup: we always have to use __error() now, and we shouldn't provide a
errno symbol, so completely remove the !_REENTRANT case.

Spotted out by:	ru
2006-11-09 01:28:16 +00:00
Ruslan Ermilov
7c11ac3da0 Remove a forgotten file. 2006-11-08 21:29:20 +00:00
Simon L. B. Nielsen
91c158a34e Fix infinite loop in corrupt archives handling in libarchive(3).
Reported by:	rink
Submitted by:	kientzle
Security:	FreeBSD-SA-06:24.libarchive
2006-11-08 14:03:50 +00:00
Olivier Houchard
05b432d2d1 Instead of re-implementing hton[ls] and friends for each arch, add a new MI
file, net/ntoh.c, which just implement them using the inline functions from
<sys/endian.h>.

Suggested by:	bde
2006-11-06 22:07:47 +00:00
Olivier Houchard
9cef667a1a Provide definitions suitable for arm big-endian. 2006-11-06 20:49:23 +00:00
Robert Watson
21f62f0771 Remove sys/uio.h include -- this is no longer required by the extattr
system call API.

MFC after:	3 weeks
2006-11-06 15:12:43 +00:00
Tim Kientzle
8a4b2112a2 Eliminate documentation references to a non-existent function. 2006-11-06 00:28:46 +00:00
Tim Kientzle
a2b1e869b7 Computing SHLIB_MAJOR is not a good idea. It's really a FreeBSD
system value that has no real relation to the libarchive version.
(Except, of course, that any ABI breakage will force both to be
incremented.)
2006-11-06 00:24:57 +00:00
Tim Kientzle
a5261c3117 Remove an unused declaration. 2006-11-06 00:16:40 +00:00
Tom Rhodes
d3dc0c9de4 Fix a typo: "the give login class" to "the given login class."
PR:		75577
Submitted by:	Nobuyuki Koganemaru
2006-11-05 19:00:08 +00:00
Sam Lawrance
6b0a380f6d Document return values for res_query and res_search.
h_errno is not an extern int, just a macro providing an integer lvalue.

PR:		doc/50573
Submitted by:	Ronald F.Guilmette <rfg@monkeys.com>
Reviewed by:	trhodes
MFC after:	3 days
2006-11-04 09:42:22 +00:00
Daniel Gerzo
137e54d3db - clock_gettime is in time.h instead of sys/time.h
Approved by: trhodes (mentor), keramida (mentor)
PR: docs/104707
MFC-after: 3 days
2006-11-04 09:35:36 +00:00
Kip Macy
7b5cdd4faf - change ABI for user trap handler for sun4v (eventually will sync sparc64 no
hardware set up to test at the moment)

Approved by: scottl (standing in for mentor rwatson)
2006-11-03 23:43:18 +00:00
Ruslan Ermilov
f19110addc Replace the SEE ALSO xrefs with a more reasonable set stolen from POSIX. 2006-11-02 14:10:56 +00:00
Matt Jacob
bd3fd815a7 2nd and final commit that moves us to CAM_NEW_TRAN_CODE
as the default.

Reviewed by multitudes.
2006-11-02 00:54:38 +00:00
Pawel Jakub Dawidek
a722f8df9e Document MNT_GJOURNAL option. 2006-11-01 23:40:44 +00:00
Pawel Jakub Dawidek
cf4652e74b Implement cgwrite1(3) function which stored a given cylinder group on disk.
Sponsored by:	home.pl
2006-10-31 21:21:48 +00:00
Bruce Evans
81f2acfc06 Backed out rev.1.10 (a special case for amd64). The amd64 mcount code
never needed any frame pointers for itself.
2006-10-28 13:34:35 +00:00
Ruslan Ermilov
0f0eddbb01 Add missing markup bits.
Submitted by:	Emil Mikulic
2006-10-28 13:05:10 +00:00
Maxim Konovalov
42cdb16b47 o Fix function name.
Obtained from:	DragonFlyBSD
MFC after:	1 week
2006-10-28 10:53:39 +00:00
John Birrell
8460a577a4 Make KSE a kernel option, turned on by default in all GENERIC
kernel configs except sun4v (which doesn't process signals properly
with KSE).

Reviewed by:	davidxu@
2006-10-26 21:42:22 +00:00
Hajimu UMEMOTO
b021e5e1ed Merge res_send.c of BIND9 9.3.3rc2 into main chunk. It includes
following fix:

	Retransmission timeouts should be based on which attempt
	it is to the nameserver and not the nameserver itself.

Obtained from:	ISC
MFC after:	3 days
2006-10-24 14:41:43 +00:00
Hajimu UMEMOTO
7c35eabcb2 Import of BIND 9.3.3rc2 2006-10-24 14:25:49 +00:00
Konstantin Belousov
525cd732f9 Revert the rev. 1.4, it causes breakage on most arches except i386.
Remove the const qualifier from ap argument for __v2printf, that induced
that breakage, and seems to be the real reason for bad code. ap is modified
inside the __v2printf body by va_arg macro.

Pointy hat to:	kib
Approved by:	pjd (mentor)
2006-10-23 07:25:25 +00:00
Simon L. B. Nielsen
27111d392c Minor markup fix: A comma should be seperated by space from macro
argument.  This resulted in "pwritev,()" instead of the intended
"pwritev()," in the output.

MFC after:	3 days
2006-10-21 20:36:50 +00:00
Ruslan Ermilov
2aeccd6ea7 Avoid a potential hard sentence break. 2006-10-21 18:03:53 +00:00
Maxim Konovalov
e82b177775 o Fix typo.
Obtained from:	DragonFlyBSD
MFC after:	1 week
2006-10-21 15:12:36 +00:00
Konstantin Belousov
129ccff2fb Workaround for (what seems to be) compiler error for gcc 3.4.6. On
i386 with default optimization level (-O2), va_list pointer ap in the
__v2printf function is advanced before the use. That cause argument
shift and garbage instead last argument in printf-family when xprintf is
activated.

The nsswitch is easy victim of the bug.

Reviewed by:	kan
Approved by:	kan (mentor)
MFC after:	1 week
2006-10-21 11:49:07 +00:00
David Xu
210a647b67 remove libc_r remanent. 2006-10-20 14:15:42 +00:00
Gleb Smirnoff
bbf889eded Include sys/socket.h to know about sa_family_t. 2006-10-17 16:56:29 +00:00