summaryrefslogtreecommitdiff
path: root/src/shared/missing.h
AgeCommit message (Collapse)Author
2014-11-22missing: add IFLA_BRPORT_LEARNING and friendsZbigniew Jędrzejewski-Szmek
IFLA_BRPORT_LEARNING was added in v3.10-rc4-583-g9ba18891f7, and IFLA_BRPORT_UNICAST_FLOOD in v3.10-rc4-584-g867a59436f.
2014-11-22missing: add __NR_getrandom for a few more archsZbigniew Jędrzejewski-Szmek
Mips has getrandom() too, but there's just too many variants for me too care. Either someone who cares does it, or they get compile-time warnings with old kernel headers.
2014-11-04Properly define the __NR_memfd_create macro for MIPSVicente Olivert Riera
This macro exists for MIPS since v3.17: https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=42944521af97a3b25516f15f3149aec3779656dc
2014-11-03journald: if available pull audit messages from the kernel into journal logsLennart Poettering
2014-10-30memfd: always create our memfds with CLOEXEC setLennart Poettering
We really shouldn't create fds ever that have the flag unset.
2014-10-30util: don't block on getrandom()Lennart Poettering
2014-10-29missing.h: fix wrong __NR_getrandom syscall defDave Reisner
278 is vmsplice on x86_64. 318 is what we want: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/x86/syscalls/syscall_64.tbl
2014-10-29missing: no tabs please, we are britishLennart Poettering
2014-10-29missing: simplify memfd ifdefferyLennart Poettering
2014-10-29util: make use of the new getrandom() syscall if it is available when ↵Lennart Poettering
needing entropy Doesn't require an fd, and could be a bit faster, so let's make use of it, if it is available.
2014-10-22resolved: simplify detection of packets from the loopback deviceLennart Poettering
We can simplify our code quite a bit if we explicitly check for the ifindex being 1 on Linux as a loopback check. Apparently, this is hardcoded on Linux on the kernel, and effectively exported to userspace via rtnl and such, hence we should be able to rely on it.
2014-10-17missing: remove fanotifyZbigniew Jędrzejewski-Szmek
It was only used in readahead.
2014-10-05build-sys: use linux/memfd.h if availableZbigniew Jędrzejewski-Szmek
linux/memfd.h was added linux 3.17, so it might not be widely available for a while. Also, check if memfd_create is defined, for the HAVE_LINUX_MEMFD_H check to have a chance of succeeding. Also, collapse all ifdefs for memfd-related stuff, because they were all added together so there's no need to check separately.
2014-10-01Remove repeated includesThomas Hindoe Paaboel Andersen
In pty.c there was both an include of our pty.h and the system installed pty.h. The latter contains only two functions openpty and forkpty. We use neither so I assume it was a typo and removed it. We still compile and pass all tests.
2014-09-16missing: memfd_create takes unsigned int flags in final versionCristian Rodríguez
2014-08-31missing: add IFF_MULTI_QUEUETom Gundersen
This was added in 3.8, but we should building with 3.7 headers. Reported by Samuli Suominen <ssuominen@gentoo.org>.
2014-08-26missing: add BPF_XORMichael Olbrich
BPF_XOR was introduced in kernel 3.7
2014-08-22missing.h: add a cpp warning for __NR_memfd_create on MIPSDaniel Mack
2014-08-22missing.h: add fake __NR_memfd_create for MIPSDaniel Mack
We don't have the correct __NR_memfd_create syscall number yet, so set it to 0xffffffff for now to prevent compile time errors.
2014-08-18memfd: fix memfd_create() syscall wrapperDaniel Mack
Unlike earlier versions, the syscall only takes 2 arguments in its final version, not 3.
2014-08-17kdbus: switch over to generic memfd implementation (ABI+API break)Daniel Mack
2014-08-08udev: link_setup - respect kernel name assign policyTom Gundersen
Newer kernels export meta-information about the origin of an ifname. Respect this from the ifname rename logic. We do not rename any interfaces that was originally named by userspace, nor once which have already been renamed from userspace. Moreover, we optionally do not (the default) rename interfaces which the kernel claims to have named in a predictable way.
2014-08-03Move BTRFS_IOC_DEVICES_READY to missing.hZbigniew Jędrzejewski-Szmek
2014-08-01missing: add missing bonding definitionsLennart Poettering
2014-07-31resolved: implement LLMNR uniqueness verificationLennart Poettering
2014-07-29resolve: add llmnr responder side for UDP and TCPLennart Poettering
Name defending is still missing.
2014-07-21Add IFLA_VTI defines to missing.hJean-André Santoni
2014-07-16missing.h: add IFLA_MACVLAN_FLAGSZbigniew Jędrzejewski-Szmek
Now we are getting into kernel < 3.4 territory... https://bugs.freedesktop.org/show_bug.cgi?id=80095
2014-06-20missing.h: add various network enumsZbigniew Jędrzejewski-Szmek
We used to check if e.g. IFLA_BOND_MAX is defined and provide fallback values in missing.h is it wasn't. But over time, various kernel versions added IFLA_* defines, so checking for IFLA_BOND_MAX is not enough if the kernel is new enough to have some of them but too old to have all. In case we detect that the latest known enum value is missing, #define most of them. https://bugs.freedesktop.org/show_bug.cgi?id=80095
2014-05-10rtnl: message - read group membership of incoming messagesTom Gundersen
2014-04-05build-sys: add newly used if_link.h defines to missing.hZbigniew Jędrzejewski-Szmek
Reported-by: Arnaud Gaboury <arnaud.gaboury@gmail.com>
2014-03-21missing: add more compat for old kernels and loop devicesLennart Poettering
https://bugs.freedesktop.org/show_bug.cgi?id=76335
2014-03-19missing: define LO_FLAGS_PARTSCAN if it is missingLennart Poettering
https://bugs.freedesktop.org/show_bug.cgi?id=76335
2014-03-05missing: if RLIMIT_RTTIME is not defined by the libc, then we need a new ↵Lennart Poettering
define for the max number of rlimits, too
2014-02-21missing: simplificationsLennart Poettering
2014-02-21build-sys: Add setns() functions if not in the C library.Holger Schurig
Debian Stable is still using glibc 2.13, which doesn't provide the setns(). So we detect this and provide a tiny wrapper that issues the setns syscall towards the kernel.
2014-02-19missing.h: add some IFLA_* constantsTom Gundersen
These were added to the kernel between 3.5 and 3.9, let's not require such recent kernels (yet).
2014-01-28Base mkostemp_safe on mkostempZbigniew Jędrzejewski-Szmek
It is nice to wrap umask handling and return convention, but glibc's mkostemp is async-signal-safe already.
2014-01-28util: define O_TMPFILE on x86/x86-64, where the generic value is usedLennart Poettering
On other archs we'll not define it so that open_tmpfile() falls back to unguessable name + unlink.
2014-01-27journal: guarantee async-signal-safety in sd_journald_sendvZbigniew Jędrzejewski-Szmek
signal(7) provides a list of functions which may be called from a signal handler. Other functions, which only call those functions and don't access global memory and are reentrant are also safe. sd_j_sendv was mostly OK, but would call mkostemp and writev in a fallback path, which are unsafe. Being able to call sd_j_sendv in a async-signal-safe way is important because it allows it be used in signal handlers. Safety is achieved by replacing mkostemp with open(O_TMPFILE) and an open-coded writev replacement which uses write. Unfortunately, O_TMPFILE is only available on kernels >= 3.11. When O_TMPFILE is unavailable, an open-coded mkostemp is used. https://bugzilla.gnome.org/show_bug.cgi?id=722889
2013-09-17logind: introduce session-devicesDavid Herrmann
A session-device is a device that is bound to a seat and used by a session-controller to run the session. This currently includes DRM, fbdev and evdev devices. A session-device can be created via RequestDevice() on the dbus API of the session. You can drop it via ReleaseDevice() again. Once the session is destroyed or you drop control of the session, all session-devices are automatically destroyed. Session devices follow the session "active" state. A device can be active/running or inactive/paused. Whenever a session is not the active session, no session-device of it can be active. That is, if a session is not in foreground, all session-devices are paused. Whenever a session becomes active, all devices are resumed/activated by logind. If it fails, a device may stay paused. With every session-device you request, you also get a file-descriptor back. logind keeps a copy of this fd and uses kernel specific calls to pause/resume the file-descriptors. For example, a DRM fd is muted by logind as long as a given session is not active. Hence, the fd of the application is also muted. Once the session gets active, logind unmutes the fd and the application will get DRM access again. This, however, requires kernel support. DRM devices provide DRM-Master for synchronization, evdev devices have EVIOCREVOKE (pending on linux-input-ML). fbdev devices do not provide such synchronization methods (and never will). Note that for evdev devices, we call EVIOCREVOKE once a session gets inactive. However, this cannot be undone (the fd is still valid but mostly unusable). So we reopen a new fd once the session is activated and send it together with the ResumeDevice() signal. With this infrastructure in place, compositors can now run without CAP_SYS_ADMIN (that is, without being root). They use RequestControl() to acquire a session and listen for devices via udev_monitor. For every device they want to open, they call RequestDevice() on logind. This returns a fd which they can use now. They no longer have to open the devices themselves or call any privileged ioctls. This is all done by logind. Session-switches are still bound to VTs. Hence, compositors will get notified via the usual VT mechanisms and can cleanup their state. Once the VT switch is acknowledged as usual, logind will get notified via sysfs and pause the old-session's devices and resume the devices of the new session. To allow using this infrastructure with systems without VTs, we provide notification signals. logind sends PauseDevice("force") dbus signals to the current session controller for every device that it pauses. And it sends ResumeDevice signals for every device that it resumes. For seats with VTs this is sent _after_ the VT switch is acknowledged. Because the compositor already acknowledged that it cleaned-up all devices. However, for seats without VTs, this is used to notify the active compositor that the session is about to be deactivated. That is, logind sends PauseDevice("force") for each active device and then performs the session-switch. The session-switch changes the "Active" property of the session which can be monitored by the compositor. The new session is activated and the ResumeDevice events are sent. For seats without VTs, this is a forced session-switch. As this is not backwards-compatible (xserver actually crashes, weston drops the related devices, ..) we also provide an acknowledged session-switch. Note that this is never used for sessions with VTs. You use the acknowledged VT-switch on these seats. An acknowledged session switch sends PauseDevice("pause") instead of PauseDevice("force") to the active session. It schedules a short timeout and waits for the session to acknowledge each of them with PauseDeviceComplete(). Once all are acknowledged, or the session ran out of time, a PauseDevice("force") is sent for all remaining active devices and the session switch is performed. Note that this is only partially implemented, yet, as we don't allow multi-session without VTs, yet. A follow up commit will hook it up and implemented the acknowledgements+timeout. The implementation is quite simple. We use major/minor exclusively to identify devices on the bus. On RequestDevice() we retrieve the udev_device from the major/minor and search for an existing "Device" object. If no exists, we create it. This guarantees us that we are notified whenever the device changes seats or is removed. We create a new SessionDevice object and link it to the related Session and Device. Session->devices is a hashtable to lookup SessionDevice objects via major/minor. Device->session_devices is a linked list so we can release all linked session-devices once a device vanishes. Now we only have to hook this up in seat_set_active() so we correctly change device states during session-switches. As mentioned earlier, these are forced state-changes as VTs are currently used exclusively for multi-session implementations. Everything else are hooks to release all session-devices once the controller changes or a session is closed or removed.
2013-08-16build-sys: Add configure check for linux/btrfs.hMichael Marineau
btrfs.h was added to uapi in Linux 3.9. To fix building with older header versions this adds a configure check for the header and re-adds btrfs definitions to missing.h which was removed in bed2e820 along with two other ioctls used by gpt-auto-generator. [ Apparently, btrfs.h was only added recently: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=55e301fd57a6239ec14b91a1cf2e70b3dd135194 let's re-add it for now -- kay ]
2013-08-13missing: use btrfs.h instead of defining our own btrfs structuresLennart Poettering
2013-07-11basic SO_REUSEPORT supportShawn Landden
2013-07-02replace tabs with spaces in various filesJason St. John
The affected files in this patch had inconsistent use of tabs vs. spaces for indentation, and this patch eliminates the stray tabs. Also, the opening brace of sigchld_hdl() in activate.c was moved so the opening braces are consistent throughout the file.
2013-05-15Fix syscall(__NR_fanotify_mark, ...) on armChengwei Yang
2013-02-13missing: define MS_REC and MS_SHARED if not defined alreadyAleksander Morgado
2012-11-25timer: recalculate next elapse for calendar timer units when the system ↵Lennart Poettering
clock is changed
2012-10-26journal: provide an API that allows client to figure out whether they need ↵Lennart Poettering
to recheck the journal manually for changes in regular intervals Network file systems generally do not offer inotify() that would work across the network. We hence cannot rely on inotify() exclusiely in those case. Provide an API to determine these cases, and suggest doing manual regular rechecks. Note that this is not complete yet, as we need to rescan journal dirs on network file systems explicitly to find new/removed files
2012-10-19make sure __NR_name_to_handle_at is correctly definedMichael Olbrich
341 is only valid for x86, so don't use it for other architectures. Add the correct numbers for ARM and PowerPC while at it.