@@ -263,20 +263,49 @@ func Execve(path *c.Char, argv **c.Char, envp **c.Char) c.Int
263
263
//go:linkname Execvp C.execvp
264
264
func Execvp (file * c.Char , argv * * c.Char ) c.Int
265
265
266
- //go:linkname Fork C.fork
267
- func Fork () c.Int
266
+ // -----------------------------------------------------------------------------
268
267
269
- //go:linkname Kill C.kill
270
- func Kill (pid c.Int , sig c.Int ) c.Int
268
+ type PidT c.Int
271
269
272
- //go:linkname Exit C.exit
273
- func Exit (c. Int )
270
+ //go:linkname Fork C.fork
271
+ func Fork () PidT
274
272
275
273
//go:linkname Getpid C.getpid
276
- func Getpid () c. Int
274
+ func Getpid () PidT
277
275
278
276
//go:linkname Getppid C.getppid
279
- func Getppid () c.Int
277
+ func Getppid () PidT
278
+
279
+ //go:linkname Kill C.kill
280
+ func Kill (pid PidT , sig c.Int ) c.Int
281
+
282
+ // If wait() returns due to a stopped or terminated child process, the process ID
283
+ // of the child is returned to the calling process. Otherwise, a value of -1 is
284
+ // returned and errno is set to indicate the error.
285
+ //
286
+ //go:linkname Wait C.wait
287
+ func Wait (statLoc * c.Int ) PidT
288
+
289
+ // If wait3(), wait4(), or waitpid() returns due to a stopped or terminated child
290
+ // process, the process ID of the child is returned to the calling process. If
291
+ // there are no children not previously awaited, -1 is returned with errno set to
292
+ // [ECHILD]. Otherwise, if WNOHANG is specified and there are no stopped or exited
293
+ // children, 0 is returned. If an error is detected or a caught signal aborts the
294
+ // call, a value of -1 is returned and errno is set to indicate the error.
295
+ //
296
+ //go:linkname Wait3 C.wait3
297
+ func Wait3 (statLoc * c.Int , options c.Int , rusage * syscall.Rusage ) PidT
298
+
299
+ //go:linkname Wait4 C.wait4
300
+ func Wait4 (pid PidT , statLoc * c.Int , options c.Int , rusage * syscall.Rusage ) PidT
301
+
302
+ //go:linkname Waitpid C.waitpid
303
+ func Waitpid (pid PidT , statLoc * c.Int , options c.Int ) PidT
304
+
305
+ // -----------------------------------------------------------------------------
306
+
307
+ //go:linkname Exit C.exit
308
+ func Exit (c.Int )
280
309
281
310
//go:linkname Getuid C.getuid
282
311
func Getuid () UidT
@@ -291,3 +320,43 @@ func Getgid() GidT
291
320
func Getegid () GidT
292
321
293
322
// -----------------------------------------------------------------------------
323
+
324
+ //go:linkname Getrlimit C.getrlimit
325
+ func Getrlimit (resource c.Int , rlp * syscall.Rlimit ) c.Int
326
+
327
+ //go:linkname Setrlimit C.setrlimit
328
+ func Setrlimit (resource c.Int , rlp * syscall.Rlimit ) c.Int
329
+
330
+ // -----------------------------------------------------------------------------
331
+
332
+ // Upon successful completion, the value 0 is returned; otherwise the value -1
333
+ // is returned and the global variable errno is set to indicate the error.
334
+ //
335
+ //go:linkname Sysctl C.sysctl
336
+ func Sysctl (
337
+ name * c.Int , namelen c.Uint ,
338
+ oldp c.Pointer , oldlenp * uintptr ,
339
+ newp c.Pointer , newlen uintptr ) c.Int
340
+
341
+ //go:linkname Sysctlbyname C.sysctlbyname
342
+ func Sysctlbyname (
343
+ name * c.Char , oldp c.Pointer , oldlenp * uintptr ,
344
+ newp c.Pointer , newlen uintptr ) c.Int
345
+
346
+ // The sysctlnametomib() function accepts an ASCII representation of the
347
+ // name, looks up the integer name vector, and returns the numeric repre-
348
+ // sentation in the mib array pointed to by mibp. The number of elements
349
+ // in the mib array is given by the location specified by sizep before the
350
+ // call, and that location gives the number of entries copied after a suc-
351
+ // cessful call. The resulting mib and size may be used in subsequent
352
+ // sysctl() calls to get the data associated with the requested ASCII
353
+ // name. This interface is intended for use by applications that want to
354
+ // repeatedly request the same variable (the sysctl() function runs in
355
+ // about a third the time as the same request made via the sysctlbyname()
356
+ // function). The sysctlnametomib() function is also useful for fetching
357
+ // mib prefixes and then adding a final component.
358
+ //
359
+ //go:linkname Sysctlnametomib C.sysctlnametomib
360
+ func Sysctlnametomib (name * c.Char , mibp * c.Int , sizep * uintptr ) c.Int
361
+
362
+ // -----------------------------------------------------------------------------
0 commit comments