44 Commits

Author SHA1 Message Date
nivkner 927ddccf10 add flags for the splice syscalls (#35)
* add splice flags

* autogenerate bindings

Co-authored-by: nivkner <nivkner@users.noreply.github.com>
2022-10-03 10:59:33 -07:00
carbotaniuman 28df18a399 Add sysinfo bindings 2022-07-11 14:59:20 -07:00
carbotaniuman af1c0c1dd4 Add inotify bindings 2022-07-11 08:01:52 -07:00
Dan Gohman 010ec215a0 Add the io-uring APIs. 2022-04-19 11:59:06 -07:00
Dan Gohman ee19b8a9bb Define TCSANOW et al for MIPS.
Define `TCSANOW`, `TCSADRAIN`, and `TCSAFLUSH` for MIPS, since MIPS
defines these differently from all other architectures, and in a way
that bindgen doesn't support.
2022-04-08 15:07:30 -07:00
Dan Gohman 5a175efc5b Fix the definition of POLLWRNORM on mips. 2022-02-11 12:32:06 -08:00
Dan Gohman b295dce82c rustfmt the gen directory. 2022-02-10 16:09:14 -08:00
Dan Gohman ad0803ceb6 Add mips and mips64 ioctl support. 2022-02-10 16:03:44 -08:00
Dan Gohman c48bcf646b Use the correct preprocessor macro for detecting riscv64.
Use a preprocessor macro which is defined by the compiler for detecting
riscv64.
2022-01-27 14:23:55 -08:00
Dan Gohman 7b371ee0d8 Define several macros used in the userfaultfd API.
Define the `UFFDIO_REGISTER_MODE_*`, `UFFDIO_COPY_MODE_*`, `UFFDIO_ZEROPAGE_MODE_*`,
and `UFFD_API` macros.
2022-01-26 18:23:42 -08:00
Dan Gohman 9ea366f5d4 Add a new ioctl module, and populate it with lots of ioctl codes. (#18)
We've been collecting manual definitions of ioctl codes for a while, and
it looks like we're going to be collecting more over time, so start trying
a different strategy: use a script and a C program to extract ioctl values
from the headers semi-automatically.

The script itself isn't very easy to run, and I'm open to ideas for how
to do it better. However, this should cover most of Linux's existing ioctls,
so hopefully we won't need to run it very often.
2022-01-26 11:35:51 -08:00
Dan Gohman 7ed63a24c8 Define TIOCGWINSZ, FIONBIO, FIONREAD, and TCGETS on powerpc64le.
Linux's macro definitions for these are too complex for bindgen, so
define these manually.
2022-01-25 11:52:57 -08:00
Dan Gohman 657f24330d Add bindings for linux/userfaultfd.h. 2022-01-25 11:50:14 -08:00
Dan Gohman f3a1d49170 Document the purpose of the code in gen/modules/general.h.
Code in general.h should contain just what's needed for interoperability
with the Linux kernel ABI. Add a comment explaining this, and tidy up
a few parts of the code to follow this advice.
2022-01-10 12:17:09 -08:00
Friedel Ziegelmayer f913f2ceb2 feat: add msghdr (#13)
* feat: add msghdr

* regen

* add ip.h and ipv6.h

* include more from socket.h

* cleanup

* cleanup types and add mmsghdr
2022-01-10 12:16:43 -08:00
Mek101 ee0ab18f98 Fix BLKSSZGET and BLKPBSZGET for mips and powerpc 2022-01-03 12:58:22 -06:00
Mek101 7e84e621ca Add BLKSSZGET and BLKPBSZGET ioctl arguments (#8)
* Add BLKPBSZGET for x86_64

* Add BLKPBSZGET for everyone but sparc

* Add BLKSSZGET for everyone but sparc

* Update reference bindings

* Fix BLKSSZGET and BLKPBSZGET included in sparc bindings

* Add BLKSSZGET and BLKPBSZGET to sparc
2021-11-02 07:19:02 -07:00
Dan Gohman bb4f3f3b9c Add <linux/sched.h>. 2021-10-04 06:09:02 -07:00
Dan Gohman eb27d30ad4 Define ARCH_SET_FS for x86 and x86_64. 2021-09-20 05:51:48 -07:00
Dan Gohman b9a73148b4 Define the user_desc struct. 2021-09-20 05:20:29 -07:00
Dan Gohman 53337176d3 Define struct linger. 2021-09-18 07:07:43 -07:00
Dan Gohman e077e6072a Add <linux/tcp.h>. 2021-09-18 05:16:05 -07:00
Dan Gohman 472b66818e Add the membarrier constants. 2021-09-16 08:06:42 -07:00
Dan Gohman 0fd4139b03 Add the Linux uname types. 2021-09-01 11:18:11 -07:00
Dan Gohman 244ed8f93e Add the Linux auxval constants. 2021-09-01 08:23:25 -07:00
bjorn3 181585dc3a Add CI (#3)
* Do a partial clone of linux

This saves a lot of disk space. The git dir for the partial clone after
all relevant versions have been checked out is 1.7GB.

* Do a sparse checkout of linux

This saves a lot of disk space. The git dir for the partial clone after all relevant versions have been checked out is <800MB.

* Fix typo

* Fix checkout on CI

* Add CI

* Make generation deterministic

Directory iteration order is non-deterministic. In practice it depends
on the exact order in which dir entries have been created. Sort the
output of fs::read_dir to ensure that generation is deterministic across
systems.

* Check for linux/.git

* Build generator in release mode

* Switch to cargo check
2021-08-22 07:47:08 -07:00
Dan Gohman df8888be8b Add defines for use with timerfd_create. 2021-07-30 13:55:02 -05:00
Dan Gohman 306d936d0f Define EPOLLET and EPOLLONESHOT. 2021-07-19 09:44:20 -07:00
Dan Gohman d78c7ace07 Define EPOLLEXCLUSIVE and EPOLLWAKEUP. 2021-07-12 14:18:44 -07:00
Dan Gohman 74da544831 Add the EPOLL event flag constants. 2021-07-12 13:47:16 -07:00
Dan Gohman 1a943d273f Add eventfd defines to the general module. 2021-07-12 12:09:40 -07:00
Dan Gohman 4861fc1c5c Add <linux/eventpoll.h> to the general module. 2021-07-12 11:03:08 -07:00
Dan Gohman f3356d8a08 Increase the Linux kernel version where we need to define __kernel_timespec. 2021-06-29 14:41:29 -07:00
Dan Gohman 0c59a6648a Suppress uninteresting warnings. 2021-06-29 14:15:30 -07:00
Dan Gohman e53add6649 Add <linux/falloc.h> to general. 2021-06-29 05:38:02 -07:00
Dan Gohman 4c665f03d9 Define __kernel_timespec and __kernel_time64_t on 2.6.32. 2021-06-21 16:00:57 -07:00
Dan Gohman 8a4ce78038 Declare AF_UNIX instead of AF_LOCAL, and declare __kernel_sa_family_t. 2021-06-21 15:48:12 -07:00
Dan Gohman 9dc33debe7 Fix the layout of struct statfs64 on 64-bit targets.
Linux's definitions for statfs and statfs64 depend on BITS_PER_LONG
being defined, so manually predefine it.

Also, remove some redundant definitions from general.h.
2021-06-19 05:49:13 -07:00
Dan Gohman 45c5c0f430 Define sockaddr_in6. 2021-06-17 05:51:14 -07:00
Dan Gohman c71951ee19 Define MSG_CMSG_CLOEXEC too. 2021-06-16 07:37:27 -07:00
Dan Gohman 64e5683709 Define the MSG_* constants. 2021-06-16 07:24:21 -07:00
Dan Gohman 74800897cd Define STD{IN,OUT,ERR}_FILENO and the RWF_* flags. 2021-06-15 19:39:08 -07:00
Dan Gohman 55a776de75 Add bindings for memfd_create. 2021-06-15 11:37:12 -07:00
Dan Gohman 1342bdbeb9 Initial checkin. 2021-06-12 07:34:49 -07:00