posix-w32.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /* classes: h_files */
  2. #ifndef SCM_POSIX_W32_H
  3. #define SCM_POSIX_W32_H
  4. /* Copyright (C) 2001, 2006 Free Software Foundation, Inc.
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public License
  8. * as published by the Free Software Foundation; either version 3 of
  9. * the License, or (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with this library; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  19. * 02110-1301 USA
  20. */
  21. #include <string.h>
  22. #define _UTSNAME_LENGTH 65
  23. #define _UTSNAME_NODENAME_LENGTH _UTSNAME_LENGTH
  24. #define _UTSNAME_DOMAIN_LENGTH _UTSNAME_LENGTH
  25. /* Structure describing the system and machine. */
  26. struct utsname
  27. {
  28. /* Name of the implementation of the operating system. */
  29. char sysname[_UTSNAME_LENGTH];
  30. /* Name of this node on the network. */
  31. char nodename[_UTSNAME_NODENAME_LENGTH];
  32. /* Current release level of this implementation. */
  33. char release[_UTSNAME_LENGTH];
  34. /* Current version level of this release. */
  35. char version[_UTSNAME_LENGTH];
  36. /* Name of the hardware type the system is running on. */
  37. char machine[_UTSNAME_LENGTH];
  38. /* Name of the domain of this node on the network. */
  39. char domainname[_UTSNAME_DOMAIN_LENGTH];
  40. };
  41. #define WNOHANG 1
  42. #define WEXITSTATUS(stat_val) ((stat_val) & 255)
  43. /* MS-Windows programs that crash due to a fatal exception exit with
  44. an exit code whose 2 MSB bits are set. */
  45. #define WIFEXITED(stat_val) (((stat_val) & 0xC0000000) == 0)
  46. #define WIFSIGNALED(stat_val) (((stat_val) & 0xC0000000) == 0xC0000000)
  47. #define WTERMSIG(stat_val) w32_status_to_termsig (stat_val)
  48. /* The funny conditional avoids a compiler warning in status:stop_sig. */
  49. #define WIFSTOPPED(stat_val) ((stat_val) == (stat_val) ? 0 : 0)
  50. #define WSTOPSIG(stat_var) (0)
  51. #define CPU_ZERO(s) memset(s,0,sizeof(*s))
  52. #define CPU_ISSET(b,s) ((*s) & (1U << (b))) != 0
  53. #define CPU_SET(b,s) (*s) |= (1U << (b))
  54. #define CPU_SETSIZE (8*sizeof(DWORD_PTR))
  55. typedef DWORD_PTR cpu_set_t;
  56. #define PRIO_PROCESS 1
  57. #define PRIO_PGRP 2
  58. #define PRIO_USER 3
  59. SCM_INTERNAL int uname (struct utsname * uts);
  60. SCM_INTERNAL int waitpid (intptr_t, int *, int);
  61. SCM_INTERNAL int w32_status_to_termsig (DWORD status);
  62. SCM_INTERNAL int start_child (const char *exec_file, char **argv,
  63. int reading, int c2p[2], int writing, int p2c[2],
  64. int infd, int outfd, int errfd);
  65. SCM_INTERNAL int kill (int pid, int sig);
  66. SCM_INTERNAL int getpriority (int which, int who);
  67. SCM_INTERNAL int setpriority (int which, int who, int nice_val);
  68. SCM_INTERNAL int sched_getaffinity (int pid, size_t mask_size, cpu_set_t *mask);
  69. SCM_INTERNAL int sched_setaffinity (int pid, size_t mask_size, cpu_set_t *mask);
  70. #define HAVE_UNAME 1
  71. #define HAVE_WAITPID 1
  72. #define HAVE_START_CHILD 1
  73. #define HAVE_KILL 1
  74. #define HAVE_GETPRIORITY 1
  75. #define HAVE_SETPRIORITY 1
  76. #define HAVE_SCHED_GETAFFINITY 1
  77. #define HAVE_SCHED_SETAFFINITY 1
  78. #endif /* SCM_POSIX_W32_H */