Commit Graph

1810 Commits

Author SHA1 Message Date
Craig Rodrigues
3e2981e8b8 Use proper function prototype for readdir().
Eliminates -Wstrict-prototypes warning

Submitted by: Joerg Sonnenberger <joerg@dragonflybsd.org>
Obtained from: DragonFlyBSD (commit 2a6aec8dab58c89961cabcfdb92e0d0ae256dea4)
2015-09-22 07:40:55 +00:00
Craig Rodrigues
996f7159b1 Use ANSI C prototypes. Eliminates -Wold-style-definition warnings. 2015-09-22 07:31:40 +00:00
Craig Rodrigues
55b6b759c8 Use ANSI C prototypes. Eliminates -Wold-style-definition warnings. 2015-09-20 20:23:16 +00:00
Craig Rodrigues
d5bf9eb518 Remove names from some prototypes 2015-09-20 20:21:49 +00:00
Craig Rodrigues
e0b54d0140 Add declarations to eliminate -Wmissing-prototypes warnings 2015-09-20 03:58:27 +00:00
Craig Rodrigues
97f3e1c2a2 Adding missing include to eliminate -Wmissing-prototypes warning 2015-09-20 03:56:57 +00:00
Craig Rodrigues
e263ec16a9 Use unsigned variables in a few places.
Eliminates gcc 4.9 warnings.
2015-09-14 18:59:01 +00:00
Craig Rodrigues
76470dd50e Use ANSI C prototypes.
Eliminates gcc 4.9 warnings.
2015-09-14 18:44:13 +00:00
Mark Johnston
d73ce4c698 Remove the v_cache_min and v_cache_max sysctls. They are unused and have
no effect.

Reviewed by:	alc
Sponsored by:	EMC / Isilon Storage Division
2015-09-11 03:00:20 +00:00
Craig Rodrigues
695ba2f98a Include stdlib.h to get devname() prototype.
Eliminates -Wmissing-prototypes warnings with gcc
2015-08-31 19:40:54 +00:00
Konstantin Belousov
3ea917837d Fix a mistake in r287292. Despite correctly stating intent in the
comment above, POSIX_SPAWN_SETSIGMASK and POSIX_SPAWN_SETSIGDEF
handlers used libthr interposed functions instead of syscalls.

Noted by:	jilles
Sponsored by:	The FreeBSD Foundation
MFC after:	6 days
2015-08-30 04:46:44 +00:00
Konstantin Belousov
bd6060a1c6 Switch libc from using _sig{procmask,action,suspend} symbols, which
are aliases for the syscall stubs and are plt-interposed, to the
libc-private aliases of internally interposed sigprocmask() etc.

Since e.g. _sigaction is not interposed by libthr, calling signal()
removes thr_sighandler() from the handler slot etc.  The result was
breaking signal semantic and rtld locking.

The added __libc_sigprocmask and other symbols are hidden, they are
not exported and cannot be called through PLT.  The setjmp/longjmp
functions for x86 were changed to use direct calls, and since
PIC_PROLOGUE only needed for functional PLT indirection on i386, it is
removed as well.

The PowerPC bug of calling the syscall directly in the setjmp/longjmp
implementation is kept as is.

Reported by:	Pete French <petefrench@ingresso.co.uk>
Tested by:	Michiel Boland <boland37@xs4all.nl>
Reviewed by:	jilles (previous version)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2015-08-29 14:25:01 +00:00
Jilles Tjoelker
89cead337a wordexp(): Improve some error codes.
Distinguish between WRDE_BADVAL and WRDE_SYNTAX based on when the error
occurred (parsing or execution), not based on whether WRDE_UNDEF was passed.

Also, return WRDE_NOSPACE for a few more unexpected results from sh.
2015-08-19 20:31:03 +00:00
Jilles Tjoelker
2e8a071293 wordexp(3): Update man page for no longer using the wordexp builtin. 2015-08-18 20:13:36 +00:00
Jason Evans
d0e79aa362 Update jemalloc to version 4.0.0. 2015-08-18 00:21:25 +00:00
Jilles Tjoelker
842ad8ac0b wordexp(): Stop using the undocumented wordexp builtin.
The functionality of the wordexp builtin is easily replaced using normal
shell code, although performance is slightly worse.

This does not mean that wordexp() will remain shell-independent -- a fully
reliable implementation of WRDE_NOCMD is really only possible using
extensions to the shell, or by adding much of the shell's code to libc.
2015-08-16 19:42:15 +00:00
Sergey Kandaurov
71b282bb92 Add missing priority argument in example code in BUGS section.
PR:		201725
Submitted by:	Thomas Cort
MFC after:	1 week
2015-07-21 09:44:45 +00:00
Baptiste Daroussin
d7852cbcf2 Since sh(1) now supports mulitbyte (only UTF-8) clarify the related BUGS
section in wordexp(3) manual page

Discussed with:	jilles
2015-07-11 13:07:50 +00:00
Patrick Kelsey
4959a176f8 Fix sysctl(3) so it returns the intended values for all mib names in
the 'user' sysctl tree, which have all been coming back 0 or empty
since r240176.

Differential Revision: https://reviews.freebsd.org/D2945
Reviewed by: sbruno
Approved by: jmallett (mentor)
MFC after: 3 days
2015-07-06 01:42:12 +00:00
Jilles Tjoelker
764a9bbee1 fts_children: preserve errno after running close/fchdir
PR:		200942
Submitted by:	Conrad Meyer
Differential Revision: https://reviews.freebsd.org/D2852
MFC after:	1 week
2015-06-20 20:54:05 +00:00
Andrew Turner
5d8564aec8 Fix __fpclassifyl when double == long double. As with r283693 this is
needed on ARM and PowerPC.

MFC after:	1 Week
2015-05-29 09:26:10 +00:00
Andrew Turner
275ac7729e Fix __isinfl on architectures where double == long double. This is the
case on at least ARM and PowerPC.

MFC after:	1 week
2015-05-29 09:23:20 +00:00
Baptiste Daroussin
a822b64165 Remove clause 3 and 4 from the license
Obtained from:	NetBSD
2015-05-21 08:38:25 +00:00
Konstantin Belousov
60a8e659bb Remove the write-only variable phent. We currently do not check the
size of the program header's entries.

Reported by:	adrian (by using gcc 4.9)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2015-05-20 15:37:15 +00:00
John Baldwin
8b2e525f52 Tweak the comment here some more. In particular, the previous opening
sentence was a bit confusing.

Noted by:	kib
2015-05-06 17:23:42 +00:00
John Baldwin
5deee724da Remove the note about seekdir() removing telldir() cookies. That was
removed back in r269204.

MFC after:	3 days
2015-05-06 15:30:05 +00:00
John Baldwin
df00427834 A few style fixes and expand the comment a bit on what _fixtelldir() is
doing.
2015-05-06 15:25:20 +00:00
Julian Elischer
af069b0649 Tweak seekdir, telldir and readdir so that when htere are deletes going on,
as seek to teh last location saved will still work. This is needed for Samba
to be able to correctly handle delete requests from windows. This does not
completely fix seekdir when deletes are present but fixes the worst of the
problems. The real solution must involve some changes to the API for eh VFS
and getdirentries(2).

Obtained from:	Panzura inc
MFC after:	1 week
2015-05-05 14:52:33 +00:00
Baptiste Daroussin
06c00e8bfd mdoc: remove end of line whitespace 2015-04-26 10:56:06 +00:00
Baptiste Daroussin
18c5321d06 Escape "Ed" 2015-04-26 10:52:37 +00:00
Baptiste Daroussin
7acd8260b5 Escape "Ed" 2015-04-26 10:29:43 +00:00
John Baldwin
179fa75e6e Reassign copyright statements on several files from Advanced
Computing Technologies LLC to Hudson River Trading LLC.

Approved by:	Hudson River Trading LLC (who owns ACT LLC)
MFC after:	1 week
2015-04-23 14:22:20 +00:00
Konstantin Belousov
a22fc06636 Remove code to support the top of the stack layout for FreeBSD 1.x/2.x
kernel, but keep explanation of the old ps_strings structure to make
it clear what sanity check tries to accomplish.

Noted by:	Oliver Pinter <oliver.pinter@hardenedbsd.org>
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2015-04-20 09:07:12 +00:00
Konstantin Belousov
3d0045bb2b Make wait6(2), waitid(3) and ppoll(2) cancellation points. The
waitid() function is required to be cancellable by the standard.  The
wait6() and ppoll() follow the other syscalls in their groups.

Reviewed by:	jhb, jilles (previous versions)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2015-04-18 21:35:41 +00:00
Andrew Turner
d422e6f9b5 Add the start of libc and libstand for arm64. Not all of the machine
dependent functions have been implemented, but this is enough for world.

Differential Revision:	https://reviews.freebsd.org/D2132
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
2015-04-07 09:52:14 +00:00
Jilles Tjoelker
d30c6f8edf fts: Don't return FTS_SLNONE if it's not a symlink (if race).
When following symlinks, fts returned FTS_SLNONE when fstatat(flag=0)
failed, but a subsequent fstatat(flag=AT_SYMLINK_NOFOLLOW) succeeded. This
incorrectly triggered if a filename existed to be read from the directory,
was deleted before the fstatat(flag=0) and created again after the
fstatat(flag=0).

Fix this by only returning FTS_SLNONE if the result from
fstatat(flag=AT_SYMLINK_NOFOLLOW) is actually a symlink. If it is not a
symlink, treat it as if fstatat(flag=0) succeeded.

PR:		196724
Reported and tested by:	pho
MFC after:	1 week
2015-04-04 20:22:12 +00:00
Jilles Tjoelker
2f61288c80 wordexp: Explicitly pass along IFS.
Per Austin group issue #884, sh should not import IFS from the environment
but always set it to $' \t\n'. For wordexp(), however, it is documented and
useful for it to use IFS from the environment.

Since sh currently imports IFS from the environment, this change has no
functional effect.

MFC after:	1 week
2015-03-31 20:51:01 +00:00
Jilles Tjoelker
73cc817ec8 setmode(): Use sysctl kern.proc.umask instead of umask() if possible.
The kern.proc.umask.<pid> sysctl allows querying the umask without
temporarily modifying it.
2015-03-26 21:58:06 +00:00
Andrew Turner
667a4af397 We won't support a.out on arm64/aarch64. As such there will be no need to
support it in nlist(3).

Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
2015-03-18 13:54:53 +00:00
Pedro F. Giffuni
b3d078e666 compat_passwd(): yet another uninitialized access to stayopen.
CID:	1018731
2015-03-06 22:22:57 +00:00
Jilles Tjoelker
c317cb51b2 nice(): Put back old return value, keeping [EPERM] error.
Commit r279154 changed the API and ABI significantly, and {NZERO} is still
wrong.

Also, preserve errno on success instead of setting it to 0.

PR:		189821
Reported by:	bde
Relnotes:	yes
2015-02-28 18:22:10 +00:00
Konstantin Belousov
eb75dcc07b Fix typo. Note that this is mostly innocent, since libthr no longer
interposes the symbol.

Noted by:	rpaulo
MFC after:	3 days
2015-02-27 19:23:01 +00:00
Pedro F. Giffuni
e382e86bb4 setmode(3): Make sure that setmode sets errno on failure.
Our man page already documented this partially but now
we have some consistent behavior.

PR:		136669
Obtained from:	NetBSD (CVS rev. 1.31, 1.33)
Relnotes:	yes
MFC after:	3 weeks
2015-02-22 20:16:44 +00:00
Jilles Tjoelker
e220ce08ef nice(): Correct return value and [EPERM] error.
PR:		189821
Obtained from:	NetBSD
Relnotes:	yes
2015-02-22 13:36:44 +00:00
Pedro F. Giffuni
0b7361b3e3 tab vs spaces. 2015-02-20 20:27:53 +00:00
Pedro F. Giffuni
a69a20fa13 Fix small memleaks in nis_passwd() and nis_group().
These only occur upon error.

Code Review:	https://reviews.freebsd.org/D1849
Reviewed by:	delphij

CID:	1016715
CID:	1016717
2015-02-20 01:02:32 +00:00
Pedro F. Giffuni
d2f783303b ulimit(3): simplify.
rlim_t is at least as large as long, so we don't need the
extra variable to keep the intermediate step. We don't
need the volatile either.

The code was tested on i386 and amd64.

Suggested by:	bde
X-MFC with:	r278803
2015-02-17 16:01:00 +00:00
Pedro F. Giffuni
78a452c36e Replace strcpy() with strlcpy()
The risk of an overrun here is very low but check the
length, JIC.

CID:	1019039
2015-02-15 21:11:07 +00:00
Pedro F. Giffuni
1a4161a15d Reverse one of the initializations from r278804.
It does no harm but this is not needed after the
correction in r278805 and I prefer to keep this
code very similar to it's original state.
2015-02-15 21:03:49 +00:00
Pedro F. Giffuni
b78ceb0a58 Mismatch in r278804. 2015-02-15 18:02:05 +00:00