linux_misc.h 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /* $OpenBSD: linux_misc.h,v 1.7 2013/10/25 04:51:39 guenther Exp $ */
  2. /* $NetBSD: linux_misc.h,v 1.3 1999/05/13 00:31:57 thorpej Exp $ */
  3. /*-
  4. * Copyright (c) 1998 The NetBSD Foundation, Inc.
  5. * All rights reserved.
  6. *
  7. * This code is derived from software contributed to The NetBSD Foundation
  8. * by Eric Haszlakiewicz.
  9. *
  10. * Redistribution and use in source and binary forms, with or without
  11. * modification, are permitted provided that the following conditions
  12. * are met:
  13. * 1. Redistributions of source code must retain the above copyright
  14. * notice, this list of conditions and the following disclaimer.
  15. * 2. Redistributions in binary form must reproduce the above copyright
  16. * notice, this list of conditions and the following disclaimer in the
  17. * documentation and/or other materials provided with the distribution.
  18. *
  19. * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  20. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  21. * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  22. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
  23. * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  24. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  25. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  26. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  27. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  28. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  29. * POSSIBILITY OF SUCH DAMAGE.
  30. */
  31. #ifndef _LINUX_MISC_H_
  32. #define _LINUX_MISC_H_
  33. /* defined for prctl(2) */
  34. #define LINUX_PR_SET_PDEATHSIG 1 /* Second arg is signal. */
  35. #define LINUX_PR_GET_PDEATHSIG 2 /*
  36. * Second arg is a ptr to return the
  37. * signal.
  38. */
  39. #define LINUX_PR_GET_KEEPCAPS 7 /* Get drop capabilities on setuid */
  40. #define LINUX_PR_SET_KEEPCAPS 8 /* Set drop capabilities on setuid */
  41. #define LINUX_PR_SET_NAME 15 /* Set process name. */
  42. #define LINUX_PR_GET_NAME 16 /* Get process name. */
  43. #define LINUX_MAX_COMM_LEN 16 /* Maximum length of process name. */
  44. /* This looks very unportable to me, but this is how Linux defines it. */
  45. struct linux_sysinfo {
  46. long uptime;
  47. unsigned long loads[3];
  48. #define LINUX_SYSINFO_LOADS_SCALE 65536
  49. unsigned long totalram;
  50. unsigned long freeram;
  51. unsigned long sharedram;
  52. unsigned long bufferram;
  53. unsigned long totalswap;
  54. unsigned long freeswap;
  55. unsigned short procs;
  56. unsigned long totalbig;
  57. unsigned long freebig;
  58. unsigned int mem_unit;
  59. char _f[20-2*sizeof(long)-sizeof(int)];
  60. };
  61. struct linux_rusage {
  62. struct linux_timeval ru_utime; /* user time used */
  63. struct linux_timeval ru_stime; /* system time used */
  64. long ru_maxrss; /* max resident set size */
  65. long ru_ixrss; /* integral shared text memory size */
  66. long ru_idrss; /* integral unshared data " */
  67. long ru_isrss; /* integral unshared stack " */
  68. long ru_minflt; /* page reclaims */
  69. long ru_majflt; /* page faults */
  70. long ru_nswap; /* swaps */
  71. long ru_inblock; /* block input operations */
  72. long ru_oublock; /* block output operations */
  73. long ru_msgsnd; /* messages sent */
  74. long ru_msgrcv; /* messages received */
  75. long ru_nsignals; /* signals received */
  76. long ru_nvcsw; /* voluntary context switches */
  77. long ru_nivcsw; /* involuntary " */
  78. };
  79. /*
  80. * Options passed to the Linux wait4() system call.
  81. */
  82. #define LINUX_WAIT4_WNOHANG 0x00000001
  83. #define LINUX_WAIT4_WUNTRACED 0x00000002
  84. #define LINUX_WAIT4_WCLONE 0x80000000
  85. #endif /* !_LINUX_MISC_H_ */