| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
These are like mkstemp() and mkstemps() but allow passing open(2) flags like
O_CLOEXEC.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
but ACM formula we use have internal state (and return value) in the
[1, 0x7ffffffe] range, so our RAND_MAX (0x7fffffff) is never reached
because it is off by one, zero is not reached too.
Correct both RAND_MAX and rand(3) return value, shifting last one
to the 0 by 1 subtracted, resulting POSIXed [0, 0x7ffffffd(=new RAND_MAX)]
range.
2) Add a checks for not overflowing on too big seeds. It may happens on
the machines, where sizeof(unsigned int) > 32 bits.
Reviewed by: bde [1]
MFC after: 2 weeks
|
|
|
|
|
|
| |
a macro with parameters. Remove a __DECONST hack and add consts instead
for gnu libiconv API compatability. This makes it work with things like
devel/boost-libs that expects to use "iconv" as though it were a pointer.
|
|
|
|
| |
Reviewed by: dfr
|
|
|
|
|
|
| |
- Reconnect with some minor modifications, in particular now selsocket()
internals are adapted to use sbintime units after recent'ish calloutng
switch.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
device names "md" or "md[0-9]*" and a "file" option are specified in
/etc/fstab like this:
md none swap sw,file=/swap.bin 0 0
- Add GBDE/GELI encrypted swap space specification support, which
rc.d/encswap supported. The /etc/fstab lines are like the following:
/dev/ada1p1.bde none swap sw 0 0
/dev/ada1p2.eli none swap sw 0 0
.eli devices accepts aalgo, ealgo, keylen, and sectorsize as options.
swapctl(8) can understand an encrypted device in the command line
like this:
# swapctl -a /dev/ada2p1.bde
- "-L" flag is added to support "late" option to defer swapon until
rc.d/mountlate runs.
- rc.d script change:
rc.d/encswap -> removed
rc.d/addswap -> just display a warning message if $swapfile is defined
rc.d/swap1 -> renamed to rc.d/swap
rc.d/swaplate -> newly added to support "late" option
These changes alleviate a race condition between device creation/removal
and swapon/swapoff.
MFC after: 1 week
Reviewed by: wblock (manual page)
|
|
|
|
|
| |
This will allow us to use C11 atomics in kernelspace, although it will
need to be included as <sys/stdatomic.h>.
|
| |
|
|
|
|
|
|
|
|
| |
cacosh, casin, casinh, catan, and catanh. Thanks to stephen@ and bde@
for working on these.
Submitted by: stephen@
Reviewed by: bde
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
implementations visible for use by applications. The functions $F that
are now weak symbols are:
allocm, calloc, dallocm, free, malloc, malloc_usable_size,
nallocm, posix_memalign, rallocm, realloc, sallocm
The non-weak implementations of $F are exported as __$F.
Submitted by: stevek@juniper.net
Reviewed by: jasone@, kib@
Approved by: jasone@ (jemalloc)
Obtained from: juniper Networks, Inc
|
|
|
|
|
|
| |
Clang allows us to initialize complex numbers using an array
initializer, casted to a complex type. GCC has a builtin called
__builtin_complex().
|
|
|
|
|
|
|
|
|
|
|
| |
It turns out that in C++11, char16_t and char32_t are built-in types;
language keywords. Just fix this by putting traditional _*_T_DECLARED
blocks around the definitions. We'll just predefine these in
<sys/_types.h>.
This also opens up the possibility to define char16_t in other header
files, if ever needed (e.g. if we would gain a <ctype.h> for
char16_t/char32_t).
|
|
|
|
| |
Spotted by: http://hacks.owlfolio.org/header-survey/
|
|
|
|
| |
Spotted by: http://hacks.owlfolio.org/header-survey/
|
|
|
|
|
|
|
|
|
|
|
|
| |
The <uchar.h> header, part of C11, adds a small number of utility
functions for 16/32-bit "universal" characters, which may or may not be
UTF-16/32. As our wchar_t is already ISO 10646, simply add light-weight
wrappers around wcrtomb() and mbrtowc().
While there, also add (non-yet-standard) _l functions, similar to the
ones we already have for the other locale-dependent functions.
Reviewed by: theraven
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The pipe2() function is similar to pipe() but allows setting FD_CLOEXEC and
O_NONBLOCK (on both sides) as part of the function.
If p points to two writable ints, pipe2(p, 0) is equivalent to pipe(p).
If the pointer is not valid, behaviour differs: pipe2() writes into the
array from the kernel like socketpair() does, while pipe() writes into the
array from an architecture-specific assembler wrapper.
Reviewed by: kan, kib
|
|
|
|
|
|
|
|
| |
By using __has_extension(c_generic_selections), we can explicitly test
whether we're dealing with a version of Clang that supports _Generic().
That way we can use the improved <tgmath.h> code, even when not using
-std=c11. This massively reduces the compilation time when invoking
these functions.
|
|
|
|
|
|
|
|
| |
- make the prototype of sl_find match NetBSD
Reviewed by: jilles
Approved by: cperciva (mentor)
MFC After: 3 days
|
|
|
|
| |
Submitted by: Christoph Mallon <christoph.mallon@gmx.de> (via private mail)
|
|
|
|
|
|
|
|
|
| |
This theoretically allows a compiler to optimize (parts of) the array
away if unused.
While there, make the array size implicit and use a _Static_assert() to
ensure that the definition matches up with the number of elements in the
list.
|
|
|
|
|
|
|
|
|
| |
routines provide write-only stdio FILE objects that store their data in a
dynamically allocated buffer. They are a string builder interface somewhat
akin to a completely dynamic sbuf.
Reviewed by: bde, jilles (earlier versions)
MFC after: 1 month
|
|
|
|
|
| |
Noticed by: kib
Approved by: kib
|
|
|
|
|
|
|
| |
a pointer to the end of the string, rather than NULL, if the character was
not found.
Approved by: theraven
|
|
|
|
|
|
| |
in /usr/include.
MFC after: 2 weeks
|
|
|
|
|
|
|
|
| |
with the respective regression test.
See http://pubs.opengroup.org/onlinepubs/9699919799/functions/fmemopen.html
Reviewed by: cognet
Approved by: cognet
|
|
|
|
| |
Submitted by: "b.f." <bf1783@googlemail.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
values with those in <sys/time.h>. Otherwise, if a program includes
<time.h> before <sys/time.h>, the CLOCK_PROCESS_CPUTIME_ID macro never
gets defined.
Reviewed by: davidxu
X-MFC-With: 239347
|
|
|
|
|
|
|
|
|
| |
NetBSD's. This output size limited versions of vis and unvis functions
as well as a set of vis variants that allow arbitrary characters to be
specified for encoding.
Finally, MIME Quoted-Printable encoding as described in RFC 2045 is
supported.
|
| |
|
|
|
|
| |
Approved by: theraven
|
|
|
|
|
|
|
|
|
| |
This adds two features:
* uid_from_user() and gid_from_group() as the reverse of user_from_uid()
and groups_from_gid().
* pwcache_userdb() and pwcache_groupdb() which allow alternative lookup
functions to be used. For example lookups from passwd and group
databases in a non-standard location.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GIANT from VFS. In addition, disconnect also netsmb, which is a base
requirement for SMBFS.
In the while SMBFS regular users can use FUSE interface and smbnetfs
port to work with their SMBFS partitions.
Also, there are ongoing efforts by vendor to support in-kernel smbfs,
so there are good chances that it will get relinked once properly locked.
This is not targeted for MFC.
|
|
|
|
| |
Pointy hat to: me
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GIANT from VFS. This code is particulary broken and fragile and other
in-kernel implementations around, found in other operating systems,
don't really seem clean and solid enough to be imported at all.
If someone wants to reconsider in-kernel NTFS implementation for
inclusion again, a fair effort for completely fixing and cleaning it
up is expected.
In the while NTFS regular users can use FUSE interface and ntfs-3g
port to work with their NTFS partitions.
This is not targeted for MFC.
|
|
|
|
|
|
|
|
|
|
|
|
| |
GIANT from VFS. In addition, disconnect also netncp, which is a base
requirement for NWFS.
In the possibility of a future maintenance of the code and later
readd to the FreeBSD base, maybe we should think about a better location
for netncp. I'm not entirely sure the / top location is actually right,
however I will let network people to comment on that more specifically.
This is not targeted for MFC.
|
|
|
|
|
|
| |
GIANT from VFS.
This is not targeted for MFC.
|
|
|
|
|
|
|
|
|
|
|
| |
After further discussion, instead of pretending to use
uid_t and gid_t as upstream Solaris and linux try to, we
are better using u_int, which is in fact what the code
can handle and best approaches the range of values used
by uid and gid.
Discussed with: bde
Reviewed by: bde
|
|
|
|
|
|
|
|
| |
This matches what upstream (OpenSolaris) does.
Tested by: David Wolfskill
Obtained from: Bull GNU/Linux NFSv4 project (libtirpc)
MFC after: 3 days
|
|
|
|
|
|
|
|
|
| |
- Evaluate the memory order argument in atomic_fetch_*_explicit macros.
- Implement atomic_store_explicit using atomic_exchange_explicit instead
of a plain assignment.
Reviewed by: theraven
MFC after: 2 weeks
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The attempt to merge changes from the linux libtirpc caused
rpc.lockd to exit after startup under unclear conditions.
After many hours of selective experiments and inconsistent results
the conclusion is that it's better to just revert everything and
restart in a future time with a much smaller subset of the
changes.
____
MFC after: 3 days
Reported by: David Wolfskill
Tested by: David Wolfskill
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Replace do-while statements with void expressions.
- Wrap __asm statements in statement expressions.
- Make the macros function-like:
- Evaluate all arguments exactly once.
- Make sure there's a sequence point between evaluation of the arguments
and the function body. Arguments should be evaluated before any memory
barriers.
- Fix use of __atomic_is_lock_free built-in. It requires the address of
an atomic variable as second argument. Use this built-in on clang as
well because clang's __c11_atomic_is_lock_free only takes the size of the
variable into account.
- In atomic_exchange_explicit put the barrier before instead of after the
__sync_lock_test_and_set call.
Reviewed by: theraven
|
|
|
|
|
|
| |
This includes adding NVMe header files to /usr/include/dev/nvme.
Sponsored by: Intel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
reside, and move there ipfw(4) and pf(4).
o Move most modified parts of pf out of contrib.
Actual movements:
sys/contrib/pf/net/*.c -> sys/netpfil/pf/
sys/contrib/pf/net/*.h -> sys/net/
contrib/pf/pfctl/*.c -> sbin/pfctl
contrib/pf/pfctl/*.h -> sbin/pfctl
contrib/pf/pfctl/pfctl.8 -> sbin/pfctl
contrib/pf/pfctl/*.4 -> share/man/man4
contrib/pf/pfctl/*.5 -> share/man/man5
sys/netinet/ipfw -> sys/netpfil/ipfw
The arguable movement is pf/net/*.h -> sys/net. There are
future plans to refactor pf includes, so I decided not to
break things twice.
Not modified bits of pf left in contrib: authpf, ftp-proxy,
tftp-proxy, pflogd.
The ipfw(4) movement is planned to be merged to stable/9,
to make head and stable match.
Discussed with: bz, luigi
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
__BEGIN_DECLS and __END_DECLS in cdefs.h take care of the
__cplusplus mangling issues so most of the definitions
were redundant.
In the few places where they were not redundant we should
use BSD style instead of the guards used upstream.
Reported by: Yuri Pankov
|
|
|
|
|
|
|
|
|
| |
C++ mangling will cause trouble with variables like __rpc_xdr
in xdr.h so rename this to XDR.
While here add proper C++ guards to RPC headers.
PR: 137443
MFC after: 2 weeks
|