# Linux: Update syscall list for 6.17 · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/c3f2de5e519926eb0029062fe8e782a6f9df9c05)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: c3f2de5e519926eb0029062fe8e782a6f9df9c05

Requested commit: c3f2de5e519926eb0029062fe8e782a6f9df9c05

Commit: c3f2de5e519926eb0029062fe8e782a6f9df9c05

Tree: 137740d5ff2f6197afbca44ca74593d8f98fa6ce

Author: Stephen Gregoratto

Committer: Stephen Gregoratto

## Message

````
Linux: Update syscall list for 6.17

The 6.17 kernel added[1] syscalls for getting/setting certain file flags
and attributes. It's meant to be a more extensible replacement for these
ioctl's:

- `FS_IOC_GETFLAGS`/`FS_IOC_SETFLAGS`.
- `FS_IOC_FSGETXATTR`/`FS_IOC_FSSETXATTR`.

The definitions of these calls are as follows:

```zig
const file_attr = extern struct {
    /// Extended flags that apply to this file. (get/set).
    xflags: u64,
    /// Preferred extent allocation size, in bytes. (get/set).
    extsize: u32,
    /// One of:
    /// - The number of data extents in this file.
    /// - If `FS_IOC_FSGETXATTRA` is set, the number of extended attribute events in the file.
    /// (get)
    nextents: u32,
    /// Project Identifier (get/set).
    projid: u32,
    /// Preferred extent allocation size for CoW operations, in bytes (get/set).
    cowextsize: u32,
};

// size=@sizeOf(file_attr)
fn file_getattr(dirfd: fd_t, path: [*:0], fattr: *file_attr, size: usize, at_flags: u32) {}
fn file_setattr(dirfd: fd_t, path: [*:0], fattr: *file_attr, size: usize, at_flags: u32) {}
```

Users need to set/check `xflags` with the `FS_XFLAG` flags defined in
`linux/fs.h`. `ioctl_xfs_fsgetxattr(2)` has more information about the
type of information one can retrieve.

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=57fcb7d930d8f00f383e995aeebdcd2b416a187a

````

## Parents

- [985a3565c6130c7279319e9c36642f0b958e6944](https://git.cafe/gitcafe/zig/commit/985a3565c6130c7279319e9c36642f0b958e6944?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/c3f2de5e519926eb0029062fe8e782a6f9df9c05?format=markdown)
