[libc-commits] [libc] [libc] Add getpid syscall wrapper for Linux (PR #220595)

Jeff Bailey via libc-commits libc-commits at lists.llvm.org
Wed Sep 2 07:59:43 PDT 2026


================
@@ -23,12 +23,9 @@
 namespace LIBC_NAMESPACE_DECL {
 namespace linux_syscalls {
 
-LIBC_INLINE gid_t getegid() {
-  // getegid is expected to always succeed, thus no error checking here.
-  return syscall_impl<gid_t>(SYS_getegid);
-}
+LIBC_INLINE pid_t getpid() { return syscall_impl<pid_t>(SYS_getpid); }
----------------
kaladron wrote:

This technically isn't wrong, but in all the others we have the return on its own line, and it confused me for a moment.  Can you please follow that pattern?

https://github.com/llvm/llvm-project/pull/220595


More information about the libc-commits mailing list