zrj [Fri, 20 Dec 2019 09:33:51 +0000 (11:33 +0200)]
Makefile.inc1: Disconnect libelf from the build.
Internal lib is no longer needed after libexecinfo changes.
zrj [Fri, 20 Dec 2019 09:21:44 +0000 (11:21 +0200)]
libexecinfo(3): Internalize libelf in symtab.c.
Previous variant had symbol conflicts against ports libelf library.
Use custom, cut down variant that provides basic set needed for
libexecinfo symtab.c, ensure symbols are static and mangled.
The libelf (as provided in contrib) is not very suitable for generic
implementation of backtrace(3) function family.
This is a temporary workaround to unbreak specific ports that are link
against libelf and libexecinfo (including static compilations).
Reported-by: Romick@users
zrj [Fri, 20 Dec 2019 09:18:37 +0000 (11:18 +0200)]
libexecinfo(3): Mangle symtab_*() symbols.
These are not part public API.
zrj [Fri, 20 Dec 2019 09:17:08 +0000 (11:17 +0200)]
libexecinfo(3): Prevent use of uninitialized.
The gelf_getshdr() and gelf_getsy() can return NULL in certain cases.
François Tigeot [Sat, 21 Dec 2019 21:18:53 +0000 (22:18 +0100)]
drm/linux: Add a few linux/sched functions
François Tigeot [Sat, 21 Dec 2019 21:13:12 +0000 (22:13 +0100)]
drm/linux: Add wait_for_completion()
François Tigeot [Sat, 21 Dec 2019 18:23:03 +0000 (19:23 +0100)]
drm: Protect irq_list with lockmgr locks
François Tigeot [Sat, 21 Dec 2019 18:19:44 +0000 (19:19 +0100)]
drm: Protect iomap_list with lockmgr locks
Roy Marples [Fri, 20 Dec 2019 22:41:26 +0000 (22:41 +0000)]
dhcpcd: Update README.DRAGONFLY
Roy Marples [Fri, 20 Dec 2019 22:39:50 +0000 (22:39 +0000)]
Merge branch 'vendor/DHCPCD'
Roy Marples [Fri, 20 Dec 2019 22:35:27 +0000 (22:35 +0000)]
Import dhcpcd-8.1.4 with the following change:
* options: Fix allocating the script option
Matthew Dillon [Fri, 20 Dec 2019 19:34:33 +0000 (11:34 -0800)]
kernel - Clean up minor kernel memory leak (2)
* Move the bzero()s because there is one case where rt_msg_buffer()
can actually be called with the msghdr already partially filled-out.
* Tested w/dsynth, openvpn should now build. This should also solve
the reported panic.
Reported-by: zrj, kworr
François Tigeot [Fri, 20 Dec 2019 14:11:44 +0000 (15:11 +0100)]
drm: Protect vmmap_list with lockmgr locks
Suggested-by: dillon
Roy Marples [Fri, 20 Dec 2019 12:16:55 +0000 (12:16 +0000)]
dhcpcd: Update README.DRAGONFLY
Roy Marples [Fri, 20 Dec 2019 12:14:18 +0000 (12:14 +0000)]
Merge branch 'vendor/DHCPCD'
Roy Marples [Fri, 20 Dec 2019 12:09:22 +0000 (12:09 +0000)]
Import dhcpcd-8.1.3 with the following changes:
* dhcpcd: Only report SSID when we have a carrier
* IPv6ND: Fix reachable test
* DHCP6: Work better with infinite addresses
* DHCP6: Suboption 3 of NTP Server is a FQDN
* DHCP6: Fix deprecating a delegated prefix
* DHCP: Ensure we have a lease to extract options from
Matthew Dillon [Thu, 19 Dec 2019 07:10:10 +0000 (23:10 -0800)]
libkvm - Minor fix to debugging code
* Fix mask generation in dump_blist() -> scanradix().
* No affect during normal operation of the library.
Submitted-by: swildner
Roy Marples [Wed, 18 Dec 2019 16:30:12 +0000 (16:30 +0000)]
inet: Add support for IPv4 /31 prefixes, as described in RFC 3021.
To run a /31 network, participating hosts MUST drop support
for directed broadcasts, and treat the first and last addresses
on subnet as unicast. The broadcast address for the prefix
should be the link local broadcast address, INADDR_BROADCAST.
Taken from FreeBSD, r226402.
Matthew Dillon [Wed, 18 Dec 2019 16:27:23 +0000 (08:27 -0800)]
kernel - Fix rman_make_alignment_flags()
* Fix rman_make_alignment_flags() to work properly up to 2^63.
Remove assumption about being able to shift a 32-bit integer
by 32, this is not hardware-portable.
* Note that this function is only used by ancient pccard code
Reported-by: swildner
Matthew Dillon [Wed, 18 Dec 2019 16:20:08 +0000 (08:20 -0800)]
rtld - Remove 'register' keyword
* Remove use of 'register'.
Matthew Dillon [Wed, 18 Dec 2019 16:18:32 +0000 (08:18 -0800)]
rtld-elf - Fix ancient C code
* Adjust malloc() (used only by rtld-elf) to use size_t and fix
a number of shift operations.
Submitted-by: swildner
Tomohiro Kusumi [Wed, 18 Dec 2019 15:04:11 +0000 (00:04 +0900)]
sys/dev/disk/dm: Fix argc test for striped target
Should be 2 since stripe # could be 0.
taken-from: NetBSD
Matthew Dillon [Wed, 18 Dec 2019 06:57:31 +0000 (22:57 -0800)]
leave - Allow up to 99 in the minutes field in + mode
* Allow the minutes field to specify up to the value 99 in
+ mode, just like microwaves and oven timers have for decades.
* Takes the app out of the dark ages and into... well, actually,
its still in the dark ages.
Requested-by: zach
François Tigeot [Tue, 17 Dec 2019 20:09:14 +0000 (21:09 +0100)]
drm: Improve sysfs implementation
* Add necessary code to really allocate or free Linux
device structs associated with connectors.
* This prevents panics in DRM_DEBUG statements
Reported-by: Peeter Must
Tomohiro Kusumi [Tue, 17 Dec 2019 16:19:16 +0000 (01:19 +0900)]
usr.sbin/fstyp: Fix copyright
hammer.c and hammer2.c aren't ported from FreeBSD.
Tomohiro Kusumi [Tue, 17 Dec 2019 15:01:00 +0000 (00:01 +0900)]
usr.sbin/fstyp: Fix copying unterminated ondisk string
Tomohiro Kusumi [Tue, 17 Dec 2019 14:43:03 +0000 (23:43 +0900)]
usr.sbin/fstyp: Expand LABEL_LEN to 512
In theory 256 could be too small for HAMMER2 especially since
2f9f168a13010344973c10c56a71514a10643642.
Matthew Dillon [Tue, 17 Dec 2019 07:05:24 +0000 (23:05 -0800)]
kernel - Clean up minor kernel memory leak
* The ifconfig sysctl code was not filling every last byte of the
returned buffer, creating a small memory leak. Zero the buffer
prior to filling it in to guarantee that no garbage is left in
these spots.
Matthew Dillon [Tue, 17 Dec 2019 07:03:52 +0000 (23:03 -0800)]
kernel - Optimize nlookup() a bit more
* Optimize the fast-path for nlookup() for non-modifying
operations (i.e. open() without O_CREAT, stat(), etc). In
such cases special directory modes need not be considered
as long as world-execute permissions are present.
Suggested-by: mjg
Matthew Dillon [Tue, 17 Dec 2019 06:58:26 +0000 (22:58 -0800)]
kernel - Refactor malloc_type to reduce static data in image
* malloc_type was embedding a SMP_MAXCPU array of kmalloc_use
structures, which winds up being 16KB a pop x 400+ MALLOC_DEFINE()
declarations.
This was over 6MB of static data in the kernel binary, and it
wasn't BSS because the declaration is initialized with some defaults.
So this reduction is significant and directly impacts both memory
use and kernel boot times.
* Change malloc_type->ks_use from an array to a pointer. Embed
a single kmalloc_use structure (ks_use0) as the default.
When ncpus is probed, the kernel now goes through all malloc_type
structures and dynamically allocates a properly-sized ks_use
array. Any new malloc hoppers after that point will also dynamically
allocate ks_use.
Sascha Wildner [Mon, 16 Dec 2019 16:26:04 +0000 (17:26 +0100)]
kern.pre.mk: Remove obsolete comment.
Matthew Dillon [Mon, 16 Dec 2019 04:42:14 +0000 (20:42 -0800)]
kern.pre.mk: Add back some Makefile code to fix VKERNEL64 (2)
* Conditionalize the last commit so it only occurs
for vkernel64 builds.
Sascha Wildner [Sun, 15 Dec 2019 22:40:33 +0000 (23:40 +0100)]
<sys/types.h>: Add some *_T_DECLARED guards for upcoming work.
These will be used when we clean up <sys/stat.h> and <dirent.h> in the
near future.
Sascha Wildner [Sun, 15 Dec 2019 22:38:47 +0000 (23:38 +0100)]
kern.pre.mk: Add back some Makefile code to fix VKERNEL64.
I removed this by mistake in
c47c81dbc5495f8c4fa01a238784813eb56a239e.
Seems this is still needed, even though we inherited it from FreeBSD
before we had the vkernel.
Reported-by: tuxillo
François Tigeot [Sun, 15 Dec 2019 22:13:04 +0000 (23:13 +0100)]
drm/linux: Fix io_mapping() functions
These functions were mostly stubs and did not properly set memory
cache attributes causing some operations like framebuffer access
to be excessively slow.
Use ioremap() variants internally to fix that.
Spotted-by: peeter, dillon
Matthew Dillon [Sun, 15 Dec 2019 20:24:02 +0000 (12:24 -0800)]
kernel - Test pending ints in more crit_exit*() paths
* A number of crit_exit*() paths, primarily in the mutex and
spinlock code, were not testing for interrupts made pending
on the last unwind of the critical section.
This was originally intended to improve performance, but it
can lead to non-deterministic latencies for processing interrupts.
* Process these pending events in such cases. We will see if it
affects performance but I don't think it will be noticeable.
Matthew Dillon [Sun, 15 Dec 2019 20:18:44 +0000 (12:18 -0800)]
kernel - Improve pmap_change_attr() when used on the DMAP
* When used on the DMAP's 1GB or 2MB pages pmap_change_attr()
basically didn't work because it tries to access terminal PTEs
(and there aren't any), instead accidently accessing the
underlying physical memory and causing corruption.
* Fix this by (1) Forcing the DMAP to use 2MB pages and
(2) special-casing DMAP addresses in pmap_change_attr()
to act on the PDEs.
* This is not a complete fix because the granularity for
any DMAP VAs will still be ~2MB and not 4K. Its use by
the DRM subsystem requires more investigation. But the
changes should improve some of the reported GPU corruption
issues.
Reported-by: peeter
Testing-by: multiple
Sascha Wildner [Sat, 14 Dec 2019 19:06:46 +0000 (20:06 +0100)]
kern.{post,pre}.mk: Clean up a bit.
kern.post.mk:
-------------
* eddep is not used in kernel context.
* linterrs and the lint target should have been removed when I removed
xlint back in
84f800532904979799aaeb8123487026f76a6640.
* setdef[01].c and setdefs.h should have been removed when gensetdefs
was removed in
5e0107f67f7c659007103f791401be27957081cf.
kern.pre.mk:
------------
* Remove some old FreeBSD inherited code that we don't need to build
a kernel without /usr/src.
* While here, Remove unneeded quotation marks around two include
directories.
zrj [Sat, 14 Dec 2019 10:24:14 +0000 (12:24 +0200)]
phantasia(6): Fix monters file permissions.
Allow games group to write too.
Reported-by: zach
Sascha Wildner [Sat, 14 Dec 2019 08:30:25 +0000 (09:30 +0100)]
kernel: Remove various (mostly commented out) references to vnode_if.[ch].
François Tigeot [Sat, 14 Dec 2019 07:08:31 +0000 (08:08 +0100)]
drm/i915: Fix VGA_SWITCHEROO option handling
Reported-by: Peeter Must
Matthew Dillon [Fri, 13 Dec 2019 19:06:34 +0000 (11:06 -0800)]
du - Add an option to generate results based on file size
* By default du generates results based on st_blkcnt, the actual
number of blocks used on-media. This value might be smaller than
the file size due to filesystem-level compression, or possibly
larger due to the filesystem also counting overhead for indirect
blocks.
* Add the -t option. This option generates results based simply
on the file size (st_size), and assumes a 512-byte media
granularity.
This option gives you an idea of the transmittable bytes if you
were to copy the file elsewhere.
Matthew Dillon [Fri, 13 Dec 2019 01:36:56 +0000 (17:36 -0800)]
sio - Refactor some of the sio code
* Refactor some of the sio serial port code to reduce the amount of
time the com_lock() is held and to allow the siointr*() receive
buffer in the softc to pipeline.
Matthew Dillon [Fri, 13 Dec 2019 01:32:53 +0000 (17:32 -0800)]
docs - Add note about powerd and serial port operation
* Serial port operation at high baud rates such as 115200 may
lose characters if powerd is allowed to reduce the CPU
frequency below 1500 MHz.
* Document this fact and include a suggestion for powerd_flags
if this is not desired.
Matthew Dillon [Thu, 12 Dec 2019 20:35:30 +0000 (12:35 -0800)]
dsynth - Improve compatibility with newer pkg's
* pkg is going through a bit of an evolution in its support for
suffixes other than .txz, causing some issues with the generation
of the database and meta file that 'pkg install' fetches.
* In versions before 1.12 pkg always generated .txz database and
meta files, but pkg install looked for the suffix specified in
meta.txz for the database files.
In this case the database files have to be recompressed to
the requested suffix.
* In versions >= 1.12 (up until the next fix), pkg generates
the requested suffix, but unfortunately also for the meta file
too whereas pkg install still looks for 'meta.txz'.
In this case the meta.<suffix> file has to be recompressed
using xz to a .txz.
* At some future point pkg repo and pkg install will match up,
and dsynth may need another commit then.
In this case no recompression will be needed to make pkg repo
and pkg install play nicely with each other.
Sascha Wildner [Thu, 12 Dec 2019 12:06:46 +0000 (13:06 +0100)]
kernel/acpi: Fix debug.acpi.allow_method_calls functionality.
Adding SMAP (Supervisor Mode Access Protection) support back in May
(see
48c77f2b85f9ed807532e99b7187e6f5b5aa2975) caused it to (correctly)
panic on certain machines, such as the Dell XPS 9560, due to trying to
use a userspace pointer from the kernel.
FreeBSD has since fixed this in their sysutils/acpi_call port. This
commit pulls in these changes.
See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230993 for the
FreeBSD PR.
Submitted-by: Khamba Staring <qdk at quickdekay.net>
François Tigeot [Thu, 12 Dec 2019 11:08:07 +0000 (12:08 +0100)]
drm/i915: Revert unintended changes in i915_params.c
They were introduced in
1487f78699db6b645ec307a207e4611f50a7cc53
Tomohiro Kusumi [Tue, 10 Dec 2019 20:02:26 +0000 (05:02 +0900)]
usr.sbin/fstyp: Add device name to HAMMER2 label for autofs -media mount
This helps autofs -media mount support multiple HAMMER2 mounts
if not perfect solution. The format may change in future.
Add minor fix to HAMMER1 label algorithm to sync with this commit.
Matthew Dillon [Wed, 11 Dec 2019 01:30:53 +0000 (17:30 -0800)]
psm - Add Elantech touchpad IC type 15 found on Thinkpad L480 laptops
* Add support for thinkpad L480 laptops.
Suggested-by: aly
Taken-from: FreeBSD
François Tigeot [Tue, 10 Dec 2019 19:39:43 +0000 (20:39 +0100)]
drm/i915: Update PCI IDs from Linux 5.4
This brings in support for previously unknown models of Skylake,
Coffelake, Amber Lake, Whiskey Lake and Comet Lake GPUs.
François Tigeot [Tue, 10 Dec 2019 19:32:08 +0000 (20:32 +0100)]
drm/i915: Update to Linux commit
1f15b76f1ec973d1eb5d21b6d98b21aebb9025f1
"Separate GPU hang waitqueue from advance"
François Tigeot [Tue, 10 Dec 2019 17:45:22 +0000 (18:45 +0100)]
drm: Stop using an embedded struct drm_device in driver softcs
* All drm drivers use a struct drm_device record but are free to
allocate it by themselves in different ways or let the generic
drm subsystem code do it.
* This drm_device record can even be part of another data structure,
dynamically or statically allocated.
* We cannot just assume the length of a drm_device structure in the
softc memory block will be enough to store all driver private data.
* Make the drm softc the equivalent of a void* pointer and let the
upstream code behave as expected on Linux
Tomohiro Kusumi [Tue, 10 Dec 2019 14:38:07 +0000 (23:38 +0900)]
usr.sbin/fstyp: Add device name to HAMMER1 label for autofs -media mount
This helps autofs -media mount support multiple HAMMER1 mounts
if not perfect solution. The format may change in future.
Note that this doesn't support HAMMER1 with multiple devices.
François Tigeot [Tue, 10 Dec 2019 08:51:04 +0000 (09:51 +0100)]
drm/linux: Stop using driver softcs for dev_set/get_drvdata()
Sascha Wildner [Sun, 8 Dec 2019 13:27:54 +0000 (14:27 +0100)]
Remove wrong getvfsbytype.3 MLINK. The manpage doesn't document it.
François Tigeot [Sun, 8 Dec 2019 09:33:39 +0000 (10:33 +0100)]
drm: Add linux/smp.h
Tomohiro Kusumi [Sun, 8 Dec 2019 02:26:09 +0000 (11:26 +0900)]
sys/vfs/msdosfs: Minor msdosfs_readdir() sync up with FreeBSD
bits from freebsd/freebsd@
d08f717585ab19a81dfc5bd8aed1ac4edcb2b157
DragonFly doesn't need dirent_terminate(), but it also doesn't need
to use strcpy() for dirent name given how vop_write_dirent() works.
Matthew Dillon [Sun, 8 Dec 2019 02:00:47 +0000 (18:00 -0800)]
hammer2 - Fix chain->error case in hammer2_chain_lookup()
* The chain->error case was not being properly handled in
hammer2_chain_lookup(), resulting in either a panic or a
permanent "xxx" stall.
* Fix the case so upper levels can properly process EIO and
related issues.
Matthew Dillon [Fri, 6 Dec 2019 19:23:40 +0000 (11:23 -0800)]
hammer2 - Rename 'bcopy' variable to 'bsave'
* Rename variable to reduce confusion
Sascha Wildner [Sun, 8 Dec 2019 01:40:12 +0000 (02:40 +0100)]
getconf(1): Support NPROCESSORS_* too in addition to _NPROCESSORS_*.
Improves compatibility with software that is used to a Linux environment.
Linux uses leading underscores in these variable names.
Pointed-out-by: zrj
Sascha Wildner [Sat, 7 Dec 2019 11:51:06 +0000 (12:51 +0100)]
<cpu/ieeefp.h>: Just include <sys/cdefs.h> instead of complaining.
Sascha Wildner [Sat, 7 Dec 2019 11:28:25 +0000 (12:28 +0100)]
<sys/cdefs.h>: Ensure that __{BSD,EXT1}_VISIBLE are never undefined.
This is to fix -Wundef warnings that might occur if the environment is
restricted to POSIX or X/Open.
Thanks to zrj for testing with a dports bulk build.
Sascha Wildner [Sat, 7 Dec 2019 11:25:14 +0000 (12:25 +0100)]
<sys/stdarg.h>: Check if __cplusplus is defined before checking its value.
François Tigeot [Sat, 7 Dec 2019 08:07:48 +0000 (09:07 +0100)]
drm/linux: Add pci_map_rom() and pci_unmap_rom()
François Tigeot [Sat, 7 Dec 2019 08:06:44 +0000 (09:06 +0100)]
drm/linux: pfn_to_page() returns a struct page*
Sascha Wildner [Sat, 7 Dec 2019 00:07:11 +0000 (01:07 +0100)]
kernel/getsockaddr: Remove a COMPAT_43 removal leftover.
It was overlooked in
d6e8ab2d2508bde32ad7b7daaf86d44ec7330986.
Discussed-with: sephe
Sascha Wildner [Fri, 6 Dec 2019 21:51:35 +0000 (22:51 +0100)]
libc: Fix some -Wmissing-prototypes warnings.
Matthew Dillon [Wed, 4 Dec 2019 18:40:25 +0000 (10:40 -0800)]
dsynth - Conditionalize .txz -> other_compression_fmt for pkg repo
* pkg version 1.12 or later properly uses the compression
suffix when generating the repo database, the results do
not need to be recompressed.
Versions prior to 1.12 needed to be recompressed for
compression formats other than .txz.
* Conditionalize based on pkg -v output.
Reported-by: zrj
Antonio Huete Jimenez [Wed, 4 Dec 2019 11:32:28 +0000 (12:32 +0100)]
mount_devfs.8: Adjust fstab example to include the mount type.
- Mount type (rw, ro, ...) is required in fstab, otherwise getfsent() will fail
with EFTYPE.
Antonio Huete Jimenez [Tue, 3 Dec 2019 23:21:17 +0000 (00:21 +0100)]
jail: Use M_PRISON for sysctl allocation
Antonio Huete Jimenez [Tue, 3 Dec 2019 17:59:25 +0000 (17:59 +0000)]
jail: Allow jails to mount nullfs(5) and tmpfs(5)
- The code is structured in a way that it should be easy to add more
filesystems in the future.
- User mounts are disabled in jails for now.
- It is not allowed for jails to unmount filesystems that were not mounted
within the jail itself.
Reviewed by: dillon, mjg
Antonio Huete Jimenez [Tue, 3 Dec 2019 15:33:37 +0000 (15:33 +0000)]
<sys/jail.h>: Add nullfs, devfs and tmpfs filesystem privs
Antonio Huete Jimenez [Tue, 3 Dec 2019 00:04:19 +0000 (00:04 +0000)]
<sys/mount.h>: Add mnt_cred field
- For now it can will be used to retrieve cr_prison which
which indicate the prison that mountpoint belongs to.
Antonio Huete Jimenez [Mon, 2 Dec 2019 23:30:11 +0000 (23:30 +0000)]
<sys/priv.h>: Add filesystem specific constants
Sascha Wildner [Mon, 2 Dec 2019 21:13:50 +0000 (22:13 +0100)]
libutil: Bring in a fparseln() bugfix from NetBSD.
Prevents fparseln() from reporting spurious empty lines when it shouldn't:
http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/stdio/fparseln.c.diff?r1=1.5&r2=1.6
While here, optimize to prevent pointless realloc()s:
http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/stdio/fparseln.c.diff?r1=1.6&r2=1.7
Reported-by: zrj
Matthew Dillon [Mon, 2 Dec 2019 21:03:30 +0000 (13:03 -0800)]
kernel - Warn on duplicate physical addresses passed from BIOS
* Warn on duplicate PA free ranges passed from the BIOS instead
of panicing.
* Try to fix buggy threadripper BIOSes.
Matthew Dillon [Mon, 2 Dec 2019 20:53:55 +0000 (12:53 -0800)]
devfs - Ensure lock held around devfs_cdev_terminate() (2)
* Fix deadlock due to synchronous message sent via
devfs_clone_bitmap_put() -> devfs_config().
Sascha Wildner [Mon, 2 Dec 2019 20:25:03 +0000 (21:25 +0100)]
sort.1: Mention that -o's argument can be one of the input files.
Matthew Dillon [Mon, 2 Dec 2019 20:12:22 +0000 (12:12 -0800)]
devfs - Ensure lock held around devfs_cdev_terminate()
* Ensure that a lock is held around devfs_cdev_terminate() on
sysref release (which can occur from any thread, not just the
devfs thread).
Antonio Huete Jimenez [Mon, 2 Dec 2019 11:53:21 +0000 (12:53 +0100)]
jail: Simplify a bit by using the new BIT64 sysctl functions
- No functional changes.
- The per-jail settings have been renamed to match the new capability
constants. The default settings will be renamed soon too.
- Fix a missing prison chflags check in ufs_settattr() and
ext2fs_setattr().
Antonio Huete Jimenez [Mon, 2 Dec 2019 01:11:39 +0000 (02:11 +0100)]
sysctl.9: Document the new BIT32/BIT64 functionality.
Antonio Huete Jimenez [Mon, 2 Dec 2019 00:48:52 +0000 (01:48 +0100)]
<sys/sysctl.h>: Add runtime interface macros for BIT32/BIT64
- Add SYSCTL_ADD_BIT32() and SYSCTL_ADD_BIT64() macros which allow using a
sysctl context.
Sascha Wildner [Sun, 1 Dec 2019 15:25:01 +0000 (16:25 +0100)]
libc: Change getlogin_r()'s second argument to size_t, as POSIX likes it.
https://pubs.opengroup.org/onlinepubs/
9699919799/functions/getlogin.html
Also adjust the getconf syscall, aka _getconf() in userland, which is
called by getconf(3) and getconf_r(3).
Approved-by: dillon
Tested-by: zrj
Sascha Wildner [Sun, 1 Dec 2019 11:55:00 +0000 (12:55 +0100)]
<sys/stat.h>: Add S_TYPEISSEM() and S_TYPEISSHM() definitions.
Sascha Wildner [Sun, 1 Dec 2019 11:32:40 +0000 (12:32 +0100)]
<sys/stat.h>: Fix odd indentation.
Sascha Wildner [Sun, 1 Dec 2019 11:03:21 +0000 (12:03 +0100)]
Rename some functions to better names.
devfs_find_device_by_udev() -> devfs_find_device_by_devid()
dev2udev() -> devid_from_dev()
udev2dev() -> dev_from_devid()
This fits with the rest of the code. 'dev' usually means a cdev_t,
such as in make_dev(), etc. Instead of 'udev', use 'devid', since
that's what dev_t is, a "Device ID".
Sascha Wildner [Sun, 1 Dec 2019 10:59:08 +0000 (11:59 +0100)]
<sys/types.h>: Get rid of udev_t.
In a time long long ago, dev_t was a pointer, which later became cdev_t
during the great cleanups, until it ended up being a uint32_t, just like
udev_t. See for example the definitions of __dev_t in <sys/stat.h>.
This commit cleans up further by removing the udev_t type, leaving just
the POSIX dev_t type for both kernel and userland. Put it inside a
_DEV_T_DECLARED to prepare for further cleanups in <sys/stat.h>.
Matthew Dillon [Sat, 30 Nov 2019 20:06:29 +0000 (12:06 -0800)]
tools - Generate valid embedded newlines in strings
* Use the posix string concat instead of actually escaping
a hard newline inside the string.
This is not legal in C any more (it used to be, ages ago):
"abc\
def"
Instead we have to use:
"abc\n"
"def"
* Fixes the awk scripts to generate valid C strings.
Reported-by: zrj
Sascha Wildner [Sat, 30 Nov 2019 13:46:40 +0000 (14:46 +0100)]
tar(1): Fix -Wundef.
Sascha Wildner [Sat, 30 Nov 2019 06:08:54 +0000 (07:08 +0100)]
m4(1): Fix -Wundef.
Sascha Wildner [Sat, 30 Nov 2019 06:07:29 +0000 (07:07 +0100)]
larn(6): Fix -Wundef.
Sascha Wildner [Sat, 30 Nov 2019 06:06:26 +0000 (07:06 +0100)]
Fix -Wundef in bzip2, libpcap, mdocml, and ncurses.
Antonio Huete Jimenez [Fri, 29 Nov 2019 19:08:20 +0000 (20:08 +0100)]
kernel: debug_64bit must be uint64_t
Sascha Wildner [Fri, 29 Nov 2019 15:13:06 +0000 (16:13 +0100)]
<stdlib.h>: Check if __cplusplus is defined before checking its value.
Sascha Wildner [Fri, 29 Nov 2019 14:21:15 +0000 (15:21 +0100)]
sshd(8): Fix -Wundef.
Sascha Wildner [Fri, 29 Nov 2019 06:35:15 +0000 (07:35 +0100)]
bthcid(8): Fix -Wundef.
Sascha Wildner [Fri, 29 Nov 2019 06:18:34 +0000 (07:18 +0100)]
boot1/edk2: Fix -Wundef.
Sascha Wildner [Fri, 29 Nov 2019 05:56:22 +0000 (06:56 +0100)]
rwhod(8): Fix -Wundef.
Antonio Huete Jimenez [Fri, 29 Nov 2019 00:33:31 +0000 (01:33 +0100)]
kernel: Don't use atomic for cr_ref in crget()
Suggested-by: mjg
Antonio Huete Jimenez [Thu, 28 Nov 2019 16:33:20 +0000 (17:33 +0100)]
kernel: Merge crinit() into crget()
* Remove crinit() which was unused and merge _crinit() into
crget() which is its only user.