Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion go-pathrs/internal/libpathrs/libpathrs_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,15 @@ func InRootHardlink(oldRootFd uintptr, oldPath string, newRootFd uintptr, newPat
}

// ProcBase is pathrs_proc_base_t (uint64_t).
type ProcBase C.pathrs_proc_base_t
//
// Spelled out rather than taken from C.pathrs_proc_base_t, because cbindgen
// since v0.29.3 emits the C23 fixed-type enum syntax for pathrs_proc_base_t,
// and in C23 mode that makes the typedef name the enum rather than uint64_t.
// CGo maps a C enum to a *signed* Go type, so none of the constants below fit
// in it and the package stops compiling. Every compiler defaulting to C23
// (gcc >= 15) is affected. The values are converted back at each call site
// anyway, so nothing else has to know which spelling the header uses.
type ProcBase uint64

// FIXME: We need to open-code the constants because CGo unfortunately will
// implicitly convert any non-literal constants (i.e. those resolved using gcc)
Expand Down
Loading