author | Claus Gittinger <cg@exept.de> |
Wed, 11 Nov 1998 16:09:46 +0100 | |
changeset 3927 | 028ca7c70ac9 |
parent 3902 | 39c11e93056a |
child 3946 | bdb1c55980c1 |
permissions | -rw-r--r-- |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2 |
COPYRIGHT (c) 1988 by Claus Gittinger |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3 |
All Rights Reserved |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5 |
This software is furnished under a license and may be used |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6 |
only in accordance with the terms of that license and with the |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
7 |
inclusion of the above copyright notice. This software may not |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
8 |
be provided or otherwise made available to, or used by, any |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
9 |
other person. No title to or ownership of the software is |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
10 |
hereby transferred. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
11 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
12 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
13 |
AbstractOperatingSystem subclass:#Win32OperatingSystem |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
14 |
instanceVariableNames:'' |
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
15 |
classVariableNames:'HostName DomainName CurrentDirectory' |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
16 |
poolDictionaries:'' |
3511 | 17 |
category:'OS-Windows' |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
18 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
19 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
20 |
Object subclass:#FileStatusInfo |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
21 |
instanceVariableNames:'type mode uid gid size id accessed modified statusChanged path |
3563 | 22 |
alternativeName' |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
23 |
classVariableNames:'' |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
24 |
poolDictionaries:'' |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
25 |
privateIn:Win32OperatingSystem |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
26 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
27 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
28 |
Object subclass:#OSProcessStatus |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
29 |
instanceVariableNames:'pid status code core' |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
30 |
classVariableNames:'' |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
31 |
poolDictionaries:'' |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
32 |
privateIn:Win32OperatingSystem |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
33 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
34 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
35 |
!Win32OperatingSystem primitiveDefinitions! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
36 |
%{ |
3817
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
37 |
|
3741 | 38 |
# define WRAP_STDIO |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
39 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
40 |
#if defined(MSWINDOWS) || defined(OS2) || defined(MSDOS) || defined(WIN32) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
41 |
# ifndef MSDOS_LIKE |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
42 |
# define MSDOS_LIKE |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
43 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
44 |
# undef UNIX_LIKE /* oops - we were too optimistic - no OS */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
45 |
# ifdef i386 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
46 |
# ifndef _X86_ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
47 |
# define _X86_ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
48 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
49 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
50 |
#endif /* any MS-non-OS */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
51 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
52 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
53 |
* notice: although many systems' include files |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
54 |
* already block against multiple inclusion, some |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
55 |
* do not. Therefore, this is done here again. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
56 |
* (it does not hurt) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
57 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
58 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
59 |
# ifndef _SIGNAL_H_INCLUDED_ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
60 |
# include <signal.h> |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
61 |
# define _SIGNAL_H_INCLUDED_ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
62 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
63 |
|
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
64 |
# ifndef _SYS_TYPES_H_INCLUDED_ |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
65 |
# include <sys/types.h> |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
66 |
# define _SYS_TYPES_H_INCLUDED_ |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
67 |
# endif |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
68 |
|
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
69 |
# ifndef _TIME_H_INCLUDED_ |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
70 |
# include <time.h> |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
71 |
# define _TIME_H_INCLUDED_ |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
72 |
# endif |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
73 |
|
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
74 |
# ifndef _SYS_TIMEB_H_INCLUDED_ |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
75 |
# include <sys/timeb.h> |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
76 |
# define _SYS_TIMEB_H_INCLUDED_ |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
77 |
# endif |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
78 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
79 |
# ifndef _SYS_STAT_H_INCLUDED_ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
80 |
# include <sys/stat.h> |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
81 |
# define _SYS_STAT_H_INCLUDED_ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
82 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
83 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
84 |
# ifndef _ERRNO_H_INCLUDED_ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
85 |
# include <errno.h> |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
86 |
# define _ERRNO_H_INCLUDED_ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
87 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
88 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
89 |
# ifndef _STDIO_H_INCLUDED_ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
90 |
# include <stdio.h> |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
91 |
# define _STDIO_H_INCLUDED_ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
92 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
93 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
94 |
# ifndef _FCNTL_H_INCLUDED_ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
95 |
# include <fcntl.h> |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
96 |
# define _FCNTL_H_INCLUDED_ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
97 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
98 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
99 |
# ifdef WIN32 |
3741 | 100 |
/*# define PROCESSDEBUGWIN32 |
101 |
# define PROCESS1DEBUGWIN32 |
|
102 |
# define PROCESS2DEBUGWIN32 |
|
103 |
# define SELECTDEBUGWIN32 |
|
104 |
# define SELECT1DEBUGWIN32 |
|
3772 | 105 |
# define SELECT2DEBUGWIN32 */ |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
106 |
# undef INT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
107 |
# undef Array |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
108 |
# undef Number |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
109 |
# undef Method |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
110 |
# undef Point |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
111 |
# undef Rectangle |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
112 |
# undef Block |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
113 |
# undef String |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
114 |
# undef Message |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
115 |
# undef Object |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
116 |
# undef Context |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
117 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
118 |
# include <stdarg.h> /* */ |
3572 | 119 |
# if defined(__BORLANDC__) |
120 |
# include <windows.h> |
|
121 |
# else |
|
3741 | 122 |
# include <windows.h> |
3594 | 123 |
# define stat _stat |
3741 | 124 |
#undef chmod |
125 |
#undef access |
|
126 |
# define chmod _chmod |
|
127 |
# define access _access |
|
128 |
#define MAXFILELEN 256 |
|
3572 | 129 |
# endif |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
130 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
131 |
# ifdef __DEF_Array |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
132 |
# define Array __DEF_Array |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
133 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
134 |
# ifdef __DEF_Number |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
135 |
# define Number __DEF_Number |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
136 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
137 |
# ifdef __DEF_Method |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
138 |
# define Method __DEF_Method |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
139 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
140 |
# ifdef __DEF_Point |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
141 |
# define Point __DEF_Point |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
142 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
143 |
# ifdef __DEF_Block |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
144 |
# define Block __DEF_Block |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
145 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
146 |
# ifdef __DEF_String |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
147 |
# define String __DEF_String |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
148 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
149 |
# ifdef __DEF_Message |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
150 |
# define Message __DEF_Message |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
151 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
152 |
# ifdef __DEF_Object |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
153 |
# define Object __DEF_Object |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
154 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
155 |
# ifdef __DEF_Context |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
156 |
# define Context __DEF_Context |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
157 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
158 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
159 |
# define INT int |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
160 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
161 |
typedef int (*intf)(int); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
162 |
BOOL __signalUserInterruptWIN32(DWORD sig); |
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
163 |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
164 |
# endif /* WIN32 */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
165 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
166 |
# if defined (HAS_LOCALECONV) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
167 |
# ifndef _LOCALE_H_INCLUDED_ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
168 |
# include <locale.h> |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
169 |
# define _LOCALE_H_INCLUDED_ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
170 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
171 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
172 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
173 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
174 |
* posix systems should define these ... |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
175 |
* but on some (older) systems, they are not. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
176 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
177 |
# ifndef S_IXUSR |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
178 |
# ifdef S_IEXEC |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
179 |
# define S_IXUSR S_IEXEC |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
180 |
# define S_IXGRP (S_IEXEC>>3) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
181 |
# define S_IXOTH (S_IEXEC>>6) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
182 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
183 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
184 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
185 |
# ifndef S_IXUSR |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
186 |
# define S_IXUSR 0100 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
187 |
# define S_IXGRP 0010 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
188 |
# define S_IXOTH 0001 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
189 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
190 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
191 |
# ifndef S_IRUSR |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
192 |
# define S_IRUSR 0400 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
193 |
# define S_IRGRP 0040 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
194 |
# define S_IROTH 0004 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
195 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
196 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
197 |
# ifndef S_IWUSR |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
198 |
# define S_IWUSR 0200 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
199 |
# define S_IWGRP 0020 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
200 |
# define S_IWOTH 0002 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
201 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
202 |
|
3572 | 203 |
# ifdef __BORLANDC__ |
204 |
# include <dir.h> |
|
205 |
# define MAXPATHLEN MAXPATH |
|
206 |
# define MAXFILELEN MAXFILE |
|
207 |
# endif |
|
208 |
||
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
209 |
# ifndef MAXPATHLEN |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
210 |
# ifndef MSDOS_LIKE |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
211 |
# ifndef NO_SYS_PARAM_H |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
212 |
# include <sys/param.h> |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
213 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
214 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
215 |
# ifndef MAXPATHLEN |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
216 |
# ifdef FILENAME_MAX /* i.e. MSDOS_LIKE */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
217 |
# define MAXPATHLEN FILENAME_MAX |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
218 |
# else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
219 |
# ifdef MAX_PATH |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
220 |
# define MAXPATHLEN MAX_PATH |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
221 |
# else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
222 |
# define MAXPATHLEN 1024 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
223 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
224 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
225 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
226 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
227 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
228 |
# if defined(HAS_UNAME) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
229 |
# include <sys/utsname.h> |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
230 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
231 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
232 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
233 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
234 |
* sigaction dummies (you won't believe these call themself ``POSIX'' systems ...) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
235 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
236 |
# ifndef SA_RESTART |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
237 |
# define SA_RESTART 0 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
238 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
239 |
# ifndef SA_SIGINFO |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
240 |
# define SA_SIGINFO 0 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
241 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
242 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
243 |
# if defined(HAS_WAITPID) || defined(HAS_WAIT3) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
244 |
# include <sys/wait.h> |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
245 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
246 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
247 |
# if defined(HAS_SYSINFO) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
248 |
# include <sys/systeminfo.h> |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
249 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
250 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
251 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
252 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
253 |
* on some systems errno is a macro ... check for it here |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
254 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
255 |
#ifndef errno |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
256 |
extern errno; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
257 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
258 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
259 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
260 |
* some (old ?) systems do not define this ... |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
261 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
262 |
#if !defined(R_OK) && !defined(_AIX) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
263 |
# define R_OK 4 /* Test for Read permission */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
264 |
# define W_OK 2 /* Test for Write permission */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
265 |
# define X_OK 1 /* Test for eXecute permission */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
266 |
# define F_OK 0 /* Test for existence of File */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
267 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
268 |
|
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
269 |
#define SIGHANDLER_ARG int |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
270 |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
271 |
#define _HANDLEVal(o) (HANDLE)(__externalAddressVal(o)) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
272 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
273 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
274 |
* not all systems have time_t and off_t |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
275 |
* explicit add of those we know to have ... |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
276 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
277 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
278 |
#ifndef TIME_T |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
279 |
# define TIME_T long |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
280 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
281 |
#ifndef OFF_T |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
282 |
# define OFF_T long |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
283 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
284 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
285 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
286 |
* where is the timezone info ? |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
287 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
288 |
#if defined(HAS_NO_TIMEZONE) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
289 |
# if defined(HAS_NO_TM_GMTOFF) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
290 |
# define TIMEZONE(tmPtr) 0 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
291 |
# else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
292 |
# define TIMEZONE(tmPtr) ((tmPtr)->tm_gmtoff) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
293 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
294 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
295 |
# ifdef MSDOS_LIKE |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
296 |
# define TIMEZONE(tmPtr) 0 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
297 |
# else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
298 |
# define TIMEZONE(tmPtr) timezone |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
299 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
300 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
301 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
302 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
303 |
! ! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
304 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
305 |
!Win32OperatingSystem primitiveFunctions! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
306 |
%{ |
3741 | 307 |
static int __isWinNT; |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
308 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
309 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
310 |
* some systems' system() is broken in that it does not correctly |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
311 |
* handle EINTR and returns failure even though it actually succeeded. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
312 |
* (LINUX is one of them) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
313 |
* Here is a fixed version. If you encounter EINTR returns from |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
314 |
* Win32OperatingSystem>>executeCommand, you ought to define WANT_SYSTEM |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
315 |
* in the xxxIntern.h file to get this fixed version. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
316 |
* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
317 |
* As an added BONUS, this system() enables interrupts while waiting |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
318 |
* for the child which enables other threads to continue. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
319 |
* (i.e. it is RT safe) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
320 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
321 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
322 |
#if defined(WANT_SYSTEM) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
323 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
324 |
# define __wait wait |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
325 |
#endif /* WANT_SYSTEM */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
326 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
327 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
328 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
329 |
* some systems do not have realpath(); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
330 |
* the alternative of reading from a 'pwp'-pipe |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
331 |
* is way too slow. Here is a realpath for the rest of us. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
332 |
* define WANT_REALPATH in the xxxIntern-file to get it. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
333 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
334 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
335 |
#if defined(HAS_REALPATH) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
336 |
# undef WANT_REALPATH |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
337 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
338 |
#if !defined(HAS_GETWD) && !defined(HAS_GETCWD) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
339 |
# undef WANT_REALPATH |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
340 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
341 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
342 |
#if defined(WANT_REALPATH) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
343 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
344 |
# ifndef NULL |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
345 |
# define NULL (char *)0 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
346 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
347 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
348 |
# define MAX_READLINKS 32 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
349 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
350 |
# ifndef MAXPATHLEN |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
351 |
# define MAXPATHLEN 1024 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
352 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
353 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
354 |
static |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
355 |
char *realpath(path, resolved_path) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
356 |
char *path; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
357 |
char resolved_path []; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
358 |
{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
359 |
char copy_path[MAXPATHLEN]; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
360 |
char link_path[MAXPATHLEN]; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
361 |
char *new_path = resolved_path; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
362 |
char *max_path; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
363 |
int readlinks = 0; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
364 |
int n; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
365 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
366 |
/* Make a copy of the source path since we may need to modify it. */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
367 |
strcpy(copy_path, path); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
368 |
path = copy_path; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
369 |
max_path = copy_path + MAXPATHLEN - 2; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
370 |
/* If it's a relative pathname use getwd for starters. */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
371 |
if (*path != '/') { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
372 |
#ifdef HAS_GETCWD |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
373 |
new_path = getcwd(new_path, MAXPATHLEN - 1); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
374 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
375 |
new_path = getwd(new_path); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
376 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
377 |
if (new_path == NULL) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
378 |
return(NULL); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
379 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
380 |
new_path += strlen(new_path); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
381 |
if (new_path[-1] != '/') |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
382 |
*new_path++ = '/'; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
383 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
384 |
else { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
385 |
*new_path++ = '/'; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
386 |
path++; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
387 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
388 |
/* Expand each slash-separated pathname component. */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
389 |
while (*path != '\0') { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
390 |
/* Ignore stray "/". */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
391 |
if (*path == '/') { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
392 |
path++; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
393 |
continue; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
394 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
395 |
if (*path == '.') { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
396 |
/* Ignore ".". */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
397 |
if (path[1] == '\0' || path[1] == '/') { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
398 |
path++; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
399 |
continue; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
400 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
401 |
if (path[1] == '.') { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
402 |
if (path[2] == '\0' || path[2] == '/') { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
403 |
path += 2; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
404 |
/* Ignore ".." at root. */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
405 |
if (new_path == resolved_path + 1) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
406 |
continue; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
407 |
/* Handle ".." by backing up. */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
408 |
while ((--new_path)[-1] != '/') |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
409 |
; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
410 |
continue; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
411 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
412 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
413 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
414 |
/* Safely copy the next pathname component. */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
415 |
while (*path != '\0' && *path != '/') { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
416 |
if (path > max_path) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
417 |
errno = ENAMETOOLONG; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
418 |
return NULL; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
419 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
420 |
*new_path++ = *path++; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
421 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
422 |
#ifdef S_IFLNK |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
423 |
/* Protect against infinite loops. */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
424 |
if (readlinks++ > MAX_READLINKS) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
425 |
errno = ELOOP; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
426 |
return NULL; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
427 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
428 |
/* See if latest pathname component is a symlink. */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
429 |
*new_path = '\0'; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
430 |
n = readlink(resolved_path, link_path, MAXPATHLEN - 1); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
431 |
if (n < 0) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
432 |
/* EINVAL means the file exists but isn't a symlink. */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
433 |
if (errno != EINVAL) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
434 |
return NULL; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
435 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
436 |
else { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
437 |
/* Note: readlink doesn't add the null byte. */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
438 |
link_path[n] = '\0'; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
439 |
if (*link_path == '/') |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
440 |
/* Start over for an absolute symlink. */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
441 |
new_path = resolved_path; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
442 |
else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
443 |
/* Otherwise back up over this component. */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
444 |
while (*(--new_path) != '/') |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
445 |
; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
446 |
/* Safe sex check. */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
447 |
if (strlen(path) + n >= MAXPATHLEN) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
448 |
errno = ENAMETOOLONG; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
449 |
return NULL; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
450 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
451 |
/* Insert symlink contents into path. */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
452 |
strcat(link_path, path); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
453 |
strcpy(copy_path, link_path); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
454 |
path = copy_path; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
455 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
456 |
#endif /* S_IFLNK */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
457 |
*new_path++ = '/'; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
458 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
459 |
/* Delete trailing slash but don't whomp a lone slash. */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
460 |
if (new_path != resolved_path + 1 && new_path[-1] == '/') |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
461 |
new_path--; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
462 |
/* Make sure it's null terminated. */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
463 |
*new_path = '\0'; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
464 |
return resolved_path; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
465 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
466 |
# define HAS_REALPATH |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
467 |
#endif /* WANT_REALPATH && not HAS_REALPATH */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
468 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
469 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
470 |
! ! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
471 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
472 |
!Win32OperatingSystem class methodsFor:'documentation'! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
473 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
474 |
copyright |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
475 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
476 |
COPYRIGHT (c) 1988 by Claus Gittinger |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
477 |
All Rights Reserved |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
478 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
479 |
This software is furnished under a license and may be used |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
480 |
only in accordance with the terms of that license and with the |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
481 |
inclusion of the above copyright notice. This software may not |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
482 |
be provided or otherwise made available to, or used by, any |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
483 |
other person. No title to or ownership of the software is |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
484 |
hereby transferred. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
485 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
486 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
487 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
488 |
documentation |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
489 |
" |
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
490 |
NOTICE: this is being developed; |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
491 |
this class resulted from extracting WIN32 specifics of the old |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
492 |
OperatingSystemClass into this sub-class. |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
493 |
You may find some leftover unix stuff, which will go away sooner |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
494 |
or later. |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
495 |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
496 |
this class realizes access to most (all ?) required operating system services; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
497 |
some of it is very specific for unix, so do not depend on |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
498 |
things available here in your applications |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
499 |
- some may not be found in other OS's or be slightly different ... |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
500 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
501 |
(On the other hand: I do not want to hide all features |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
502 |
from you - in some situations it MAY be interesting to be |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
503 |
able to get down to a select or fork system call easily (at least on Unix systems). |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
504 |
You decide - portability vs. functionality) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
505 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
506 |
[Class variables:] |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
507 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
508 |
HostName <String> remembered hostname |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
509 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
510 |
DomainName <String> remembered domainname |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
511 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
512 |
CurrentDirectory <String> remembered currentDirectories path |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
513 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
514 |
[author:] |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
515 |
Claus Gittinger |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
516 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
517 |
[see also:] |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
518 |
OSProcessStatus |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
519 |
Filename Date Time |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
520 |
ExternalStream FileStream PipeStream Socket |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
521 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
522 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
523 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
524 |
examples |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
525 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
526 |
various queries |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
527 |
[exBegin] |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
528 |
Transcript |
3796 | 529 |
showCR:'hello ' , (OperatingSystem getLoginName) |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
530 |
[exEnd] |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
531 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
532 |
[exBegin] |
3792 | 533 |
OperatingSystem isUNIXlike ifTrue:[ |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
534 |
Transcript showCR:'this is some UNIX-like OS' |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
535 |
] ifFalse:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
536 |
Transcript showCR:'this OS is not UNIX-like' |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
537 |
] |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
538 |
[exEnd] |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
539 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
540 |
[exBegin] |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
541 |
Transcript |
3796 | 542 |
showCR:'this machine is called ' , OperatingSystem getHostName |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
543 |
[exEnd] |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
544 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
545 |
[exBegin] |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
546 |
Transcript |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
547 |
showCR:('this machine is in the ' |
3796 | 548 |
, OperatingSystem getDomainName |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
549 |
, ' domain') |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
550 |
[exEnd] |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
551 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
552 |
[exBegin] |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
553 |
Transcript |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
554 |
showCR:('this machine''s CPU is a ' |
3796 | 555 |
, OperatingSystem getCPUType |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
556 |
) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
557 |
[exEnd] |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
558 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
559 |
[exBegin] |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
560 |
Transcript showCR:'executing ls command ...'. |
3796 | 561 |
OperatingSystem executeCommand:'ls'. |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
562 |
Transcript showCR:'... done.'. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
563 |
[exEnd] |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
564 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
565 |
locking a file |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
566 |
(should be executed on two running smalltalks - not in two threads): |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
567 |
[exBegin] |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
568 |
|f| |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
569 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
570 |
f := 'testFile' asFilename readWriteStream. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
571 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
572 |
10 timesRepeat:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
573 |
'about to lock ...' printCR. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
574 |
[ |
3796 | 575 |
OperatingSystem |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
576 |
lockFD:(f fileDescriptor) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
577 |
shared:false |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
578 |
blocking:false |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
579 |
] whileFalse:[ |
3796 | 580 |
'process ' print. OperatingSystem getProcessId print. ' is waiting' printCR. |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
581 |
Delay waitForSeconds:1 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
582 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
583 |
'LOCKED ...' printCR. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
584 |
Delay waitForSeconds:10. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
585 |
'unlock ...' printCR. |
3796 | 586 |
(OperatingSystem |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
587 |
unlockFD:(f fileDescriptor)) printCR. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
588 |
Delay waitForSeconds:3. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
589 |
] |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
590 |
[exBegin] |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
591 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
592 |
! ! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
593 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
594 |
!Win32OperatingSystem class methodsFor:'initialization'! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
595 |
|
3810 | 596 |
initOSType |
597 |
"internal - see if running under win-NT |
|
598 |
(as opposed to win-95)" |
|
599 |
||
600 |
%{ |
|
601 |
OSVERSIONINFO osvi; |
|
602 |
||
603 |
memset(&osvi, 0, sizeof(OSVERSIONINFO)); |
|
604 |
osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); |
|
605 |
GetVersionEx (&osvi); |
|
606 |
||
607 |
if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) { |
|
608 |
__isWinNT = 1; |
|
609 |
} else { |
|
610 |
__isWinNT = 0; |
|
611 |
} |
|
612 |
%}. |
|
613 |
! |
|
614 |
||
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
615 |
initialize |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
616 |
"initialize the class" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
617 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
618 |
ObjectMemory addDependent:self. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
619 |
HostName := nil. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
620 |
DomainName := nil. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
621 |
LastErrorNumber := nil. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
622 |
PipeFailed := false. |
3810 | 623 |
self initOSType |
624 |
||
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
625 |
"Modified: 13.9.1997 / 10:47:32 / cg" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
626 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
627 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
628 |
update:something with:aParameter from:changedObject |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
629 |
"catch image restart and flush some cached data" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
630 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
631 |
something == #earlyRestart ifTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
632 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
633 |
flush cached data |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
634 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
635 |
HostName := nil. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
636 |
DomainName := nil. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
637 |
LastErrorNumber := nil. |
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
638 |
PipeFailed := false. |
3810 | 639 |
self initOSType |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
640 |
] |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
641 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
642 |
"Modified: 22.4.1996 / 13:10:43 / cg" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
643 |
"Created: 15.6.1996 / 15:22:37 / cg" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
644 |
"Modified: 7.1.1997 / 19:36:11 / stefan" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
645 |
! ! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
646 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
647 |
!Win32OperatingSystem class methodsFor:'OS signal constants'! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
648 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
649 |
sigABRT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
650 |
"return the signal number for SIGABRT - 0 if not supported by OS |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
651 |
(the numeric value is not the same across unix-systems)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
652 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
653 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
654 |
#ifdef SIGABRT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
655 |
RETURN ( __MKSMALLINT(SIGABRT) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
656 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
657 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
658 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
659 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
660 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
661 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
662 |
sigALRM |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
663 |
"return the signal number for SIGALRM - 0 if not supported |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
664 |
(the numeric value is not the same across unix-systems)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
665 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
666 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
667 |
#ifdef SIGALRM |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
668 |
RETURN ( __MKSMALLINT(SIGALRM) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
669 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
670 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
671 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
672 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
673 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
674 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
675 |
sigBREAK |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
676 |
"return the signal number for SIGBREAK - 0 if not supported. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
677 |
This is an MSDOS specific signal" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
678 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
679 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
680 |
#ifdef SIGBREAK |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
681 |
RETURN ( __MKSMALLINT(SIGBREAK) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
682 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
683 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
684 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
685 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
686 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
687 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
688 |
sigBUS |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
689 |
"return the signal number for SIGBUS - 0 if not supported |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
690 |
(the numeric value is not the same across unix-systems)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
691 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
692 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
693 |
#ifdef SIGBUS |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
694 |
RETURN ( __MKSMALLINT(SIGBUS) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
695 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
696 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
697 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
698 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
699 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
700 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
701 |
sigCHLD |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
702 |
"return the signal number for SIGCHLD - 0 if not supported |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
703 |
(the numeric value is not the same across unix-systems)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
704 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
705 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
706 |
#if defined(SIGCHLD) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
707 |
RETURN ( __MKSMALLINT(SIGCHLD) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
708 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
709 |
# if defined(SIGCLD) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
710 |
RETURN ( __MKSMALLINT(SIGCLD) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
711 |
# else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
712 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
713 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
714 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
715 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
716 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
717 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
718 |
sigCONT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
719 |
"return the signal number for SIGCONT - 0 if not supported |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
720 |
(the numeric value is not the same across unix-systems)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
721 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
722 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
723 |
#if defined(SIGCONT) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
724 |
RETURN ( __MKSMALLINT(SIGCONT) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
725 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
726 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
727 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
728 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
729 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
730 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
731 |
sigDANGER |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
732 |
"return the signal number for SIGDANGER - 0 if not supported |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
733 |
(seems to be an AIX special)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
734 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
735 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
736 |
#if defined(SIGDANGER) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
737 |
RETURN ( __MKSMALLINT(SIGDANGER) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
738 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
739 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
740 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
741 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
742 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
743 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
744 |
sigEMT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
745 |
"return the signal number for SIGEMT - 0 if not supported by OS |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
746 |
(the numeric value is not the same across unix-systems)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
747 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
748 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
749 |
#ifdef SIGEMT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
750 |
RETURN ( __MKSMALLINT(SIGEMT) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
751 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
752 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
753 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
754 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
755 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
756 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
757 |
sigFP |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
758 |
"return the signal number for SIGFP - 0 if not supported by OS |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
759 |
(the numeric value is not the same across unix-systems)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
760 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
761 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
762 |
#ifdef SIGFPE |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
763 |
RETURN ( __MKSMALLINT(SIGFPE) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
764 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
765 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
766 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
767 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
768 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
769 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
770 |
sigGRANT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
771 |
"return the signal number for SIGGRANT - 0 if not supported |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
772 |
(seems to be an AIX special)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
773 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
774 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
775 |
#if defined(SIGGRANT) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
776 |
RETURN ( __MKSMALLINT(SIGGRANT) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
777 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
778 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
779 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
780 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
781 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
782 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
783 |
sigHUP |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
784 |
"return the signal number for SIGHUP |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
785 |
(the numeric value is not the same across unix-systems)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
786 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
787 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
788 |
#ifdef SIGHUP |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
789 |
RETURN ( __MKSMALLINT(SIGHUP) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
790 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
791 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
792 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
793 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
794 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
795 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
796 |
sigILL |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
797 |
"return the signal number for SIGILL - 0 if not supported by OS |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
798 |
(the numeric value is not the same across unix-systems)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
799 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
800 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
801 |
#ifdef SIGILL |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
802 |
RETURN ( __MKSMALLINT(SIGILL) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
803 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
804 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
805 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
806 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
807 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
808 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
809 |
sigINT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
810 |
"return the signal number for SIGINT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
811 |
(the numeric value is not the same across unix-systems)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
812 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
813 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
814 |
#ifdef SIGINT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
815 |
RETURN ( __MKSMALLINT(SIGINT) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
816 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
817 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
818 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
819 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
820 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
821 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
822 |
sigIO |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
823 |
"return the signal number for SIGIO - 0 if not supported |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
824 |
(the numeric value is not the same across unix-systems)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
825 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
826 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
827 |
#if defined(SIGIO) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
828 |
RETURN ( __MKSMALLINT(SIGIO) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
829 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
830 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
831 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
832 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
833 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
834 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
835 |
sigIOT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
836 |
"return the signal number for SIGIOT - 0 if not supported by OS |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
837 |
(the numeric value is not the same across unix-systems)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
838 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
839 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
840 |
#ifdef SIGIOT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
841 |
RETURN ( __MKSMALLINT(SIGIOT) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
842 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
843 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
844 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
845 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
846 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
847 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
848 |
sigKILL |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
849 |
"return the signal number for SIGKILL |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
850 |
(the numeric value is not the same across unix-systems)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
851 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
852 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
853 |
#ifdef SIGKILL |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
854 |
RETURN ( __MKSMALLINT(SIGKILL) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
855 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
856 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
857 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
858 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
859 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
860 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
861 |
sigLOST |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
862 |
"return the signal number for SIGLOST - 0 if not supported |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
863 |
(the numeric value is not the same across unix-systems)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
864 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
865 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
866 |
#if defined(SIGLOST) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
867 |
RETURN ( __MKSMALLINT(SIGLOST) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
868 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
869 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
870 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
871 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
872 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
873 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
874 |
sigMIGRATE |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
875 |
"return the signal number for SIGMIGRATE - 0 if not supported |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
876 |
(seems to be an AIX special)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
877 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
878 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
879 |
#if defined(SIGMIGRATE) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
880 |
RETURN ( __MKSMALLINT(SIGMIGRATE) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
881 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
882 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
883 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
884 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
885 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
886 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
887 |
sigMSG |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
888 |
"return the signal number for SIGMSG - 0 if not supported |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
889 |
(seems to be an AIX special)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
890 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
891 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
892 |
#if defined(SIGMSG) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
893 |
RETURN ( __MKSMALLINT(SIGMSG) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
894 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
895 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
896 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
897 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
898 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
899 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
900 |
sigPIPE |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
901 |
"return the signal number for SIGPIPE - 0 if not supported |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
902 |
(the numeric value is not the same across unix-systems)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
903 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
904 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
905 |
#ifdef SIGPIPE |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
906 |
RETURN ( __MKSMALLINT(SIGPIPE) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
907 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
908 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
909 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
910 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
911 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
912 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
913 |
sigPOLL |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
914 |
"return the signal number for SIGPOLL - 0 if not supported |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
915 |
(the numeric value is not the same across unix-systems)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
916 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
917 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
918 |
#if defined(SIGPOLL) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
919 |
RETURN ( __MKSMALLINT(SIGPOLL) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
920 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
921 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
922 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
923 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
924 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
925 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
926 |
sigPRE |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
927 |
"return the signal number for SIGPRE - 0 if not supported |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
928 |
(seems to be an AIX special)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
929 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
930 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
931 |
#if defined(SIGPRE) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
932 |
RETURN ( __MKSMALLINT(SIGPRE) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
933 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
934 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
935 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
936 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
937 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
938 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
939 |
sigPROF |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
940 |
"return the signal number for SIGPROF - 0 if not supported |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
941 |
(the numeric value is not the same across unix-systems)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
942 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
943 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
944 |
#if defined(SIGPROF) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
945 |
RETURN ( __MKSMALLINT(SIGPROF) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
946 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
947 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
948 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
949 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
950 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
951 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
952 |
sigPWR |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
953 |
"return the signal number for SIGPWR - 0 if not supported |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
954 |
(not available on all systems)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
955 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
956 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
957 |
#if defined(SIGPWR) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
958 |
RETURN ( __MKSMALLINT(SIGPWR) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
959 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
960 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
961 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
962 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
963 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
964 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
965 |
sigQUIT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
966 |
"return the signal number for SIGQUIT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
967 |
(the numeric value is not the same across unix-systems)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
968 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
969 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
970 |
#ifdef SIGQUIT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
971 |
RETURN ( __MKSMALLINT(SIGQUIT) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
972 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
973 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
974 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
975 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
976 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
977 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
978 |
sigRETRACT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
979 |
"return the signal number for SIGRETRACT - 0 if not supported |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
980 |
(seems to be an AIX special)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
981 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
982 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
983 |
#if defined(SIGRETRACT) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
984 |
RETURN ( __MKSMALLINT(SIGRETRACT) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
985 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
986 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
987 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
988 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
989 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
990 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
991 |
sigSAK |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
992 |
"return the signal number for SIGSAK - 0 if not supported |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
993 |
(seems to be an AIX special)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
994 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
995 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
996 |
#if defined(SIGSAK) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
997 |
RETURN ( __MKSMALLINT(SIGSAK) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
998 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
999 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1000 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1001 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1002 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1003 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1004 |
sigSEGV |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1005 |
"return the signal number for SIGSEGV - 0 if not supported |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1006 |
(the numeric value is not the same across unix-systems)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1007 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1008 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1009 |
#ifdef SIGSEGV |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1010 |
RETURN ( __MKSMALLINT(SIGSEGV) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1011 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1012 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1013 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1014 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1015 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1016 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1017 |
sigSOUND |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1018 |
"return the signal number for SIGSOUND - 0 if not supported |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1019 |
(seems to be an AIX special)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1020 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1021 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1022 |
#if defined(SIGSOUND) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1023 |
RETURN ( __MKSMALLINT(SIGSOUND) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1024 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1025 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1026 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1027 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1028 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1029 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1030 |
sigSTOP |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1031 |
"return the signal number for SIGSTOP - 0 if not supported |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1032 |
(the numeric value is not the same across unix-systems)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1033 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1034 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1035 |
#if defined(SIGSTOP) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1036 |
RETURN ( __MKSMALLINT(SIGSTOP) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1037 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1038 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1039 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1040 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1041 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1042 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1043 |
sigSYS |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1044 |
"return the signal number for SIGSYS - 0 if not supported |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1045 |
(the numeric value is not the same across unix-systems)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1046 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1047 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1048 |
#ifdef SIGSYS |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1049 |
RETURN ( __MKSMALLINT(SIGSYS) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1050 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1051 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1052 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1053 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1054 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1055 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1056 |
sigTERM |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1057 |
"return the signal number for SIGTERM - 0 if not supported |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1058 |
(the numeric value is not the same across unix-systems)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1059 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1060 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1061 |
#ifdef SIGTERM |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1062 |
RETURN ( __MKSMALLINT(SIGTERM) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1063 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1064 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1065 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1066 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1067 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1068 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1069 |
sigTRAP |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1070 |
"return the signal number for SIGTRAP - 0 if not supported by OS |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1071 |
(the numeric value is not the same across unix-systems)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1072 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1073 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1074 |
#ifdef SIGTRAP |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1075 |
RETURN ( __MKSMALLINT(SIGTRAP) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1076 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1077 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1078 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1079 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1080 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1081 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1082 |
sigTSTP |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1083 |
"return the signal number for SIGTSTP - 0 if not supported |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1084 |
(the numeric value is not the same across unix-systems)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1085 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1086 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1087 |
#if defined(SIGTSTP) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1088 |
RETURN ( __MKSMALLINT(SIGTSTP) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1089 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1090 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1091 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1092 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1093 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1094 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1095 |
sigTTIN |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1096 |
"return the signal number for SIGTTIN - 0 if not supported |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1097 |
(the numeric value is not the same across unix-systems)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1098 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1099 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1100 |
#if defined(SIGTTIN) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1101 |
RETURN ( __MKSMALLINT(SIGTTIN) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1102 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1103 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1104 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1105 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1106 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1107 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1108 |
sigTTOU |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1109 |
"return the signal number for SIGTTOU - 0 if not supported |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1110 |
(the numeric value is not the same across unix-systems)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1111 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1112 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1113 |
#if defined(SIGTTOU) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1114 |
RETURN ( __MKSMALLINT(SIGTTOU) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1115 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1116 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1117 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1118 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1119 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1120 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1121 |
sigURG |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1122 |
"return the signal number for SIGURG - 0 if not supported |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1123 |
(the numeric value is not the same across unix-systems)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1124 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1125 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1126 |
#if defined(SIGURG) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1127 |
RETURN ( __MKSMALLINT(SIGURG) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1128 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1129 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1130 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1131 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1132 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1133 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1134 |
sigUSR1 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1135 |
"return the signal number for SIGUSR1 - 0 if not supported |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1136 |
(the numeric value is not the same across unix-systems)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1137 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1138 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1139 |
#if defined(SIGUSR1) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1140 |
RETURN ( __MKSMALLINT(SIGUSR1) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1141 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1142 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1143 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1144 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1145 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1146 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1147 |
sigUSR2 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1148 |
"return the signal number for SIGUSR2 - 0 if not supported |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1149 |
(the numeric value is not the same across unix-systems)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1150 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1151 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1152 |
#if defined(SIGUSR2) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1153 |
RETURN ( __MKSMALLINT(SIGUSR2) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1154 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1155 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1156 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1157 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1158 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1159 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1160 |
sigVTALRM |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1161 |
"return the signal number for SIGVTALRM - 0 if not supported |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1162 |
(the numeric value is not the same across unix-systems)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1163 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1164 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1165 |
#if defined(SIGVTALRM) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1166 |
RETURN ( __MKSMALLINT(SIGVTALRM) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1167 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1168 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1169 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1170 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1171 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1172 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1173 |
sigWINCH |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1174 |
"return the signal number for SIGWINCH - 0 if not supported |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1175 |
(the numeric value is not the same across unix-systems)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1176 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1177 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1178 |
#if defined(SIGWINCH) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1179 |
RETURN ( __MKSMALLINT(SIGWINCH) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1180 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1181 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1182 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1183 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1184 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1185 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1186 |
sigXCPU |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1187 |
"return the signal number for SIGXCPU - 0 if not supported |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1188 |
(the numeric value is not the same across unix-systems)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1189 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1190 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1191 |
#if defined(SIGXCPU) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1192 |
RETURN ( __MKSMALLINT(SIGXCPU) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1193 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1194 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1195 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1196 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1197 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1198 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1199 |
sigXFSZ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1200 |
"return the signal number for SIGXFSZ - 0 if not supported |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1201 |
(the numeric value is not the same across unix-systems)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1202 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1203 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1204 |
#if defined(SIGXFSZ) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1205 |
RETURN ( __MKSMALLINT(SIGXFSZ) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1206 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1207 |
RETURN ( __MKSMALLINT(0) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1208 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1209 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1210 |
! ! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1211 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1212 |
!Win32OperatingSystem class methodsFor:'error messages'! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1213 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1214 |
currentErrorNumber |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1215 |
"returns the OS's last error nr (i.e. the value of errno). |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1216 |
Notice, that the value of this flag is only valid immediately |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1217 |
after the error occurred - it gets updated with every other |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1218 |
request to the OS. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1219 |
Use lastErrorNumber - currentErrorNumber is invalidated by |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1220 |
many, many internal calls." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1221 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1222 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1223 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1224 |
RETURN ( __MKSMALLINT(errno) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1225 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1226 |
" |
3796 | 1227 |
OperatingSystem currentErrorNumber |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1228 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1229 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1230 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1231 |
errorNumberFor:aSymbol |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1232 |
"given a symbolic error, return the numeric; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1233 |
(i.e. errorNumberFor:#EBADF returns EBADF's value). |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1234 |
Use this, since error numbers are really not standard across unix systems." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1235 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1236 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1237 |
OBJ sym = aSymbol; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1238 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1239 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1240 |
* POSIX errnos - these should be defined |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1241 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1242 |
#ifdef EPERM |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1243 |
if (sym == @symbol(EPERM)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1244 |
RETURN ( __MKSMALLINT(EPERM) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1245 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1246 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1247 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1248 |
#ifdef ENOENT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1249 |
if (sym == @symbol(ENOENT)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1250 |
RETURN ( __MKSMALLINT(ENOENT) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1251 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1252 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1253 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1254 |
#ifdef ESRCH |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1255 |
if (sym == @symbol(ESRCH)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1256 |
RETURN ( __MKSMALLINT(ESRCH) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1257 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1258 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1259 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1260 |
#ifdef EINTR |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1261 |
if (sym == @symbol(EINTR)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1262 |
RETURN ( __MKSMALLINT(EINTR) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1263 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1264 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1265 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1266 |
#ifdef EIO |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1267 |
if (sym == @symbol(EIO)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1268 |
RETURN ( __MKSMALLINT(EIO) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1269 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1270 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1271 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1272 |
#ifdef ENXIO |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1273 |
if (sym == @symbol(ENXIO)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1274 |
RETURN ( __MKSMALLINT(ENXIO) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1275 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1276 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1277 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1278 |
#ifdef E2BIG |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1279 |
if (sym == @symbol(E2BIG)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1280 |
RETURN ( __MKSMALLINT(E2BIG) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1281 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1282 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1283 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1284 |
#ifdef ENOEXEC |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1285 |
if (sym == @symbol(ENOEXEC)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1286 |
RETURN ( __MKSMALLINT(ENOEXEC) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1287 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1288 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1289 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1290 |
#ifdef EBADF |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1291 |
if (sym == @symbol(EBADF)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1292 |
RETURN ( __MKSMALLINT(EBADF) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1293 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1294 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1295 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1296 |
#ifdef ECHILD |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1297 |
if (sym == @symbol(ECHILD)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1298 |
RETURN ( __MKSMALLINT(ECHILD) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1299 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1300 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1301 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1302 |
#if defined(EAGAIN) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1303 |
if (sym == @symbol(EAGAIN)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1304 |
RETURN ( __MKSMALLINT(EAGAIN) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1305 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1306 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1307 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1308 |
#ifdef ENOMEM |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1309 |
if (sym == @symbol(ENOMEM)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1310 |
RETURN ( __MKSMALLINT(ENOMEM) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1311 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1312 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1313 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1314 |
#ifdef EACCES |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1315 |
if (sym == @symbol(EACCES)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1316 |
RETURN ( __MKSMALLINT(EACCES) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1317 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1318 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1319 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1320 |
#ifdef EFAULT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1321 |
if (sym == @symbol(EFAULT)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1322 |
RETURN ( __MKSMALLINT(EFAULT) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1323 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1324 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1325 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1326 |
#ifdef EBUSY |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1327 |
if (sym == @symbol(EBUSY)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1328 |
RETURN ( __MKSMALLINT(EBUSY) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1329 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1330 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1331 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1332 |
#ifdef EXDEV |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1333 |
if (sym == @symbol(EXDEV)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1334 |
RETURN ( __MKSMALLINT(EXDEV) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1335 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1336 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1337 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1338 |
#ifdef ENODEV |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1339 |
if (sym == @symbol(ENODEV)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1340 |
RETURN ( __MKSMALLINT(ENODEV) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1341 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1342 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1343 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1344 |
#ifdef ENOTDIR |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1345 |
if (sym == @symbol(ENOTDIR)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1346 |
RETURN ( __MKSMALLINT(ENOTDIR) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1347 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1348 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1349 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1350 |
#ifdef EISDIR |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1351 |
if (sym == @symbol(EISDIR)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1352 |
RETURN ( __MKSMALLINT(EISDIR) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1353 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1354 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1355 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1356 |
#ifdef EINVAL |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1357 |
if (sym == @symbol(EINVAL)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1358 |
RETURN ( __MKSMALLINT(EINVAL) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1359 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1360 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1361 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1362 |
#ifdef ENFILE |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1363 |
if (sym == @symbol(ENFILE)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1364 |
RETURN ( __MKSMALLINT(ENFILE) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1365 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1366 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1367 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1368 |
#ifdef EMFILE |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1369 |
if (sym == @symbol(EMFILE)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1370 |
RETURN ( __MKSMALLINT(EMFILE) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1371 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1372 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1373 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1374 |
#ifdef ENOTTY |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1375 |
if (sym == @symbol(ENOTTY)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1376 |
RETURN ( __MKSMALLINT(ENOTTY) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1377 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1378 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1379 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1380 |
#ifdef EFBIG |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1381 |
if (sym == @symbol(EFBIG)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1382 |
RETURN ( __MKSMALLINT(EFBIG) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1383 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1384 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1385 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1386 |
#ifdef ENOSPC |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1387 |
if (sym == @symbol(ENOSPC)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1388 |
RETURN ( __MKSMALLINT(ENOSPC) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1389 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1390 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1391 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1392 |
#ifdef ESPIPE |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1393 |
if (sym == @symbol(ESPIPE)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1394 |
RETURN ( __MKSMALLINT(ESPIPE) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1395 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1396 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1397 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1398 |
#ifdef EROFS |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1399 |
if (sym == @symbol(EROFS)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1400 |
RETURN ( __MKSMALLINT(EROFS) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1401 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1402 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1403 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1404 |
#ifdef EMLINK |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1405 |
if (sym == @symbol(EMLINK)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1406 |
RETURN ( __MKSMALLINT(EMLINK) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1407 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1408 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1409 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1410 |
#ifdef EPIPE |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1411 |
if (sym == @symbol(EPIPE)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1412 |
RETURN ( __MKSMALLINT(EPIPE) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1413 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1414 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1415 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1416 |
#ifdef EDOM |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1417 |
if (sym == @symbol(EDOM)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1418 |
RETURN ( __MKSMALLINT(EDOM) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1419 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1420 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1421 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1422 |
#ifdef ERANGE |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1423 |
if (sym == @symbol(ERANGE)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1424 |
RETURN ( __MKSMALLINT(ERANGE) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1425 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1426 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1427 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1428 |
#ifdef EDEADLK |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1429 |
if (sym == @symbol(EDEADLK)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1430 |
RETURN ( __MKSMALLINT(EDEADLK) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1431 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1432 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1433 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1434 |
#ifdef ENAMETOOLONG |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1435 |
if (sym == @symbol(ENAMETOOLONG)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1436 |
RETURN ( __MKSMALLINT(ENAMETOOLONG) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1437 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1438 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1439 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1440 |
#ifdef ENOLCK |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1441 |
if (sym == @symbol(ENOLCK)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1442 |
RETURN ( __MKSMALLINT(ENOLCK) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1443 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1444 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1445 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1446 |
#ifdef ENOSYS |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1447 |
if (sym == @symbol(ENOSYS)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1448 |
RETURN ( __MKSMALLINT(ENOSYS) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1449 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1450 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1451 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1452 |
#ifdef ENOTEMPTY |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1453 |
if (sym == @symbol(ENOTEMPTY)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1454 |
RETURN ( __MKSMALLINT(ENOTEMPTY) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1455 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1456 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1457 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1458 |
#ifdef EEXIST |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1459 |
if (sym == @symbol(EEXIST)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1460 |
RETURN ( __MKSMALLINT(EEXIST) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1461 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1462 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1463 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1464 |
#ifdef EILSEQ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1465 |
if (sym == @symbol(EILSEQ)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1466 |
RETURN ( __MKSMALLINT(EILSEQ) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1467 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1468 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1469 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1470 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1471 |
* XPG3 errnos - defined on most systems |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1472 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1473 |
#ifdef ENOTBLK |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1474 |
if (sym == @symbol(ENOTBLK)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1475 |
RETURN ( __MKSMALLINT(ENOTBLK) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1476 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1477 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1478 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1479 |
#ifdef ETXTBSY |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1480 |
if (sym == @symbol(ETXTBSY)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1481 |
RETURN ( __MKSMALLINT(ETXTBSY) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1482 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1483 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1484 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1485 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1486 |
* some others |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1487 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1488 |
#ifdef EWOULDBLOCK |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1489 |
if (sym == @symbol(EWOULDBLOCK)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1490 |
RETURN ( __MKSMALLINT(EWOULDBLOCK) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1491 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1492 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1493 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1494 |
#ifdef ENOMSG |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1495 |
if (sym == @symbol(ENOMSG)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1496 |
RETURN ( __MKSMALLINT(ENOMSG) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1497 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1498 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1499 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1500 |
#ifdef ELOOP |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1501 |
if (sym == @symbol(ELOOP)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1502 |
RETURN ( __MKSMALLINT(ELOOP) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1503 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1504 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1505 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1506 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1507 |
* some stream errors |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1508 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1509 |
#ifdef ETIME |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1510 |
if (sym == @symbol(ETIME)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1511 |
RETURN ( __MKSMALLINT(ETIME) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1512 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1513 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1514 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1515 |
#ifdef ENOSR |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1516 |
if (sym == @symbol(ENOSR)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1517 |
RETURN ( __MKSMALLINT(ENOSR) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1518 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1519 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1520 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1521 |
#ifdef ENOSTR |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1522 |
if (sym == @symbol(ENOSTR)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1523 |
RETURN ( __MKSMALLINT(ENOSTR) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1524 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1525 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1526 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1527 |
#ifdef ECOMM |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1528 |
if (sym == @symbol(ECOMM)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1529 |
RETURN ( __MKSMALLINT(ECOMM) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1530 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1531 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1532 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1533 |
#ifdef EPROTO |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1534 |
if (sym == @symbol(EPROTO)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1535 |
RETURN ( __MKSMALLINT(EPROTO) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1536 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1537 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1538 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1539 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1540 |
* nfs errors |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1541 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1542 |
#ifdef ESTALE |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1543 |
if (sym == @symbol(ESTALE)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1544 |
RETURN ( __MKSMALLINT(ESTALE) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1545 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1546 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1547 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1548 |
#ifdef EREMOTE |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1549 |
if (sym == @symbol(EREMOTE)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1550 |
RETURN ( __MKSMALLINT(EREMOTE) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1551 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1552 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1553 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1554 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1555 |
* some networking errors |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1556 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1557 |
#ifdef EINPROGRESS |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1558 |
if (sym == @symbol(EINPROGRESS)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1559 |
RETURN ( __MKSMALLINT(EINPROGRESS) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1560 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1561 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1562 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1563 |
#ifdef EALREADY |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1564 |
if (sym == @symbol(EALREADY)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1565 |
RETURN ( __MKSMALLINT(EALREADY) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1566 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1567 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1568 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1569 |
#ifdef ENOTSOCK |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1570 |
if (sym == @symbol(ENOTSOCK)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1571 |
RETURN ( __MKSMALLINT(ENOTSOCK) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1572 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1573 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1574 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1575 |
#ifdef EDESTADDRREQ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1576 |
if (sym == @symbol(EDESTADDRREQ)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1577 |
RETURN ( __MKSMALLINT(EDESTADDRREQ) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1578 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1579 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1580 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1581 |
#ifdef EMSGSIZE |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1582 |
if (sym == @symbol(EMSGSIZE)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1583 |
RETURN ( __MKSMALLINT(EMSGSIZE) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1584 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1585 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1586 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1587 |
#ifdef EPROTOTYPE |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1588 |
if (sym == @symbol(EPROTOTYPE)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1589 |
RETURN ( __MKSMALLINT(EPROTOTYPE) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1590 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1591 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1592 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1593 |
#ifdef ENOPROTOOPT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1594 |
if (sym == @symbol(ENOPROTOOPT)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1595 |
RETURN ( __MKSMALLINT(ENOPROTOOPT) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1596 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1597 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1598 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1599 |
#ifdef EPROTONOSUPPORT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1600 |
if (sym == @symbol(EPROTONOSUPPORT)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1601 |
RETURN ( __MKSMALLINT(EPROTONOSUPPORT) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1602 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1603 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1604 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1605 |
#ifdef ESOCKTNOSUPPORT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1606 |
if (sym == @symbol(ESOCKTNOSUPPORT)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1607 |
RETURN ( __MKSMALLINT(ESOCKTNOSUPPORT) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1608 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1609 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1610 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1611 |
#ifdef EOPNOTSUPP |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1612 |
if (sym == @symbol(EOPNOTSUPP)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1613 |
RETURN ( __MKSMALLINT(EOPNOTSUPP) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1614 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1615 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1616 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1617 |
#ifdef EPFNOSUPPORT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1618 |
if (sym == @symbol(EPFNOSUPPORT)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1619 |
RETURN ( __MKSMALLINT(EPFNOSUPPORT) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1620 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1621 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1622 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1623 |
#ifdef EAFNOSUPPORT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1624 |
if (sym == @symbol(EAFNOSUPPORT)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1625 |
RETURN ( __MKSMALLINT(EAFNOSUPPORT) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1626 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1627 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1628 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1629 |
#ifdef EADDRINUSE |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1630 |
if (sym == @symbol(EADDRINUSE)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1631 |
RETURN ( __MKSMALLINT(EADDRINUSE) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1632 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1633 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1634 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1635 |
#ifdef EADDRNOTAVAIL |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1636 |
if (sym == @symbol(EADDRNOTAVAIL)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1637 |
RETURN ( __MKSMALLINT(EADDRNOTAVAIL) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1638 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1639 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1640 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1641 |
#ifdef ETIMEDOUT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1642 |
if (sym == @symbol(ETIMEDOUT)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1643 |
RETURN ( __MKSMALLINT(ETIMEDOUT) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1644 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1645 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1646 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1647 |
#ifdef ECONNREFUSED |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1648 |
if (sym == @symbol(ECONNREFUSED)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1649 |
RETURN ( __MKSMALLINT(ECONNREFUSED) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1650 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1651 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1652 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1653 |
#ifdef ENETDOWN |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1654 |
if (sym == @symbol(ENETDOWN)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1655 |
RETURN ( __MKSMALLINT(ENETDOWN) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1656 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1657 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1658 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1659 |
#ifdef ENETUNREACH |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1660 |
if (sym == @symbol(ENETUNREACH)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1661 |
RETURN ( __MKSMALLINT(ENETUNREACH) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1662 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1663 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1664 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1665 |
#ifdef ENETRESET |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1666 |
if (sym == @symbol(ENETRESET)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1667 |
RETURN ( __MKSMALLINT(ENETRESET) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1668 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1669 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1670 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1671 |
#ifdef ECONNABORTED |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1672 |
if (sym == @symbol(ECONNABORTED)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1673 |
RETURN ( __MKSMALLINT(ECONNABORTED) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1674 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1675 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1676 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1677 |
#ifdef ECONNRESET |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1678 |
if (sym == @symbol(ECONNRESET)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1679 |
RETURN ( __MKSMALLINT(ECONNRESET) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1680 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1681 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1682 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1683 |
#ifdef EISCONN |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1684 |
if (sym == @symbol(EISCONN)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1685 |
RETURN ( __MKSMALLINT(EISCONN) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1686 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1687 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1688 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1689 |
#ifdef ENOTCONN |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1690 |
if (sym == @symbol(ENOTCONN)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1691 |
RETURN ( __MKSMALLINT(ENOTCONN) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1692 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1693 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1694 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1695 |
#ifdef ESHUTDOWN |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1696 |
if (sym == @symbol(ESHUTDOWN)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1697 |
RETURN ( __MKSMALLINT(ESHUTDOWN) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1698 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1699 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1700 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1701 |
#ifdef EHOSTDOWN |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1702 |
if (sym == @symbol(EHOSTDOWN)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1703 |
RETURN ( __MKSMALLINT(EHOSTDOWN) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1704 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1705 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1706 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1707 |
#ifdef EHOSTUNREACH |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1708 |
if (sym == @symbol(EHOSTUNREACH)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1709 |
RETURN ( __MKSMALLINT(EHOSTUNREACH) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1710 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1711 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1712 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1713 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1714 |
^ -1 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1715 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1716 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1717 |
errorSymbolAndTextForNumber:errNr |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1718 |
"return an array consisting of symbol & message string from a unix errorNumber |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1719 |
(as returned by a system call). |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1720 |
The returned message is in english (as found in /usr/include/errno.h) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1721 |
and should be replaced by a resource lookup before being presented to the user." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1722 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1723 |
|sym text| |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1724 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1725 |
%{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1726 |
/* claus: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1727 |
* I made this primitive code, since errnos are not |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1728 |
* standard across unixes |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1729 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1730 |
char *msg = "unknown error"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1731 |
char buffer[128]; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1732 |
OBJ eno = errNr; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1733 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1734 |
if (__isSmallInteger(eno)) { |
3861
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1735 |
int __eno = __intVal(eno); |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1736 |
|
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1737 |
if (__isWIN32Error(__eno)) { |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1738 |
switch (__eno & 0xFFFF) { |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1739 |
/* |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1740 |
* WIN32 GetLastError returns |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1741 |
*/ |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1742 |
case ERROR_BAD_FORMAT: |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1743 |
msg = "Bad Format"; |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1744 |
sym = @symbol(ERROR_BAD_FORMAT); |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1745 |
break; |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1746 |
|
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1747 |
case ERROR_FILE_NOT_FOUND: |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1748 |
msg = "File not found"; |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1749 |
sym = @symbol(ERROR_FILE_NOT_FOUND); |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1750 |
break; |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1751 |
|
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1752 |
case ERROR_PATH_NOT_FOUND: |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1753 |
msg = "Path not found"; |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1754 |
sym = @symbol(ERROR_PATH_NOT_FOUND); |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1755 |
break; |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1756 |
|
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1757 |
case ERROR_TOO_MANY_OPEN_FILES: |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1758 |
msg = "Too many open files"; |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1759 |
sym = @symbol(ERROR_TOO_MANY_OPEN_FILES); |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1760 |
break; |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1761 |
|
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1762 |
case ERROR_ACCESS_DENIED: |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1763 |
msg = "Access denied"; |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1764 |
sym = @symbol(ERROR_ACCESS_DENIED); |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1765 |
break; |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1766 |
|
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1767 |
case ERROR_INVALID_HANDLE: |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1768 |
msg = "Invalid handle"; |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1769 |
sym = @symbol(ERROR_INVALID_HANDLE); |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1770 |
break; |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1771 |
|
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1772 |
case ERROR_NOT_ENOUGH_MEMORY: |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1773 |
msg = "Not enough memory"; |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1774 |
sym = @symbol(ERROR_NOT_ENOUGH_MEMORY); |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1775 |
break; |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1776 |
|
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1777 |
case ERROR_INVALID_ACCESS: |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1778 |
msg = "Invalid access"; |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1779 |
sym = @symbol(ERROR_INVALID_ACCESS); |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1780 |
break; |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1781 |
|
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1782 |
case ERROR_OUTOFMEMORY: |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1783 |
msg = "Out of memory"; |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1784 |
sym = @symbol(ERROR_OUTOFMEMORY); |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1785 |
break; |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1786 |
|
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1787 |
case ERROR_BROKEN_PIPE: |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1788 |
msg = "Broken pipe"; |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1789 |
sym = @symbol(ERROR_BROKEN_PIPE); |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1790 |
break; |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1791 |
|
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1792 |
case ERROR_WRITE_PROTECT: |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1793 |
msg = "Write protected"; |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1794 |
sym = @symbol(ERROR_WRITE_PROTECT); |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1795 |
break; |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1796 |
|
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1797 |
case ERROR_WRITE_FAULT: |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1798 |
msg = "Write fault"; |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1799 |
sym = @symbol(ERROR_WRITE_FAULT); |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1800 |
break; |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1801 |
|
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1802 |
case ERROR_READ_FAULT: |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1803 |
msg = "Read fault"; |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1804 |
sym = @symbol(ERROR_READ_FAULT); |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1805 |
break; |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1806 |
|
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1807 |
case ERROR_HANDLE_DISK_FULL: |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1808 |
msg = "Disk full"; |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1809 |
sym = @symbol(ERROR_HANDLE_DISK_FULL); |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1810 |
break; |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1811 |
|
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1812 |
default: |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1813 |
sym = nil; |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1814 |
break; |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1815 |
} |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1816 |
} else { |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
1817 |
switch (__eno) { |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1818 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1819 |
* POSIX errnos - these should be defined |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1820 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1821 |
#ifdef EPERM |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1822 |
case EPERM: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1823 |
msg = "Operation not permitted"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1824 |
sym = @symbol(EPERM); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1825 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1826 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1827 |
#ifdef ENOENT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1828 |
case ENOENT: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1829 |
msg = "No such file or directory"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1830 |
sym = @symbol(ENOENT); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1831 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1832 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1833 |
#ifdef ESRCH |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1834 |
case ESRCH: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1835 |
msg = "No such process"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1836 |
sym = @symbol(ESRCH); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1837 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1838 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1839 |
#ifdef EINTR |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1840 |
case EINTR: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1841 |
msg = "Interrupted system call"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1842 |
sym = @symbol(EINTR); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1843 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1844 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1845 |
#ifdef EIO |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1846 |
case EIO: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1847 |
msg = "I/O error"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1848 |
sym = @symbol(EIO); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1849 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1850 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1851 |
#ifdef ENXIO |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1852 |
case ENXIO: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1853 |
msg = "No such device or address"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1854 |
sym = @symbol(ENXIO); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1855 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1856 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1857 |
#ifdef E2BIG |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1858 |
case E2BIG: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1859 |
msg = "Arg list too long"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1860 |
sym = @symbol(E2BIG); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1861 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1862 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1863 |
#ifdef ENOEXEC |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1864 |
case ENOEXEC: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1865 |
msg = "Exec format error"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1866 |
sym = @symbol(ENOEXEC); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1867 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1868 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1869 |
#ifdef EBADF |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1870 |
case EBADF: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1871 |
msg = "Bad file number"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1872 |
sym = @symbol(EBADF); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1873 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1874 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1875 |
#ifdef ECHILD |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1876 |
case ECHILD: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1877 |
msg = "No child processes"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1878 |
sym = @symbol(ECHILD); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1879 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1880 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1881 |
#if !defined(EWOULDBLOCK) && defined(EAGAIN) && (EWOULDBLOCK != EAGAIN) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1882 |
case EAGAIN: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1883 |
msg = "Try again"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1884 |
sym = @symbol(EAGAIN); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1885 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1886 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1887 |
#ifdef ENOMEM |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1888 |
case ENOMEM: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1889 |
msg = "Out of memory"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1890 |
sym = @symbol(ENOMEM); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1891 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1892 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1893 |
#ifdef EACCES |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1894 |
case EACCES: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1895 |
msg = "Permission denied"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1896 |
sym = @symbol(EACCES); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1897 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1898 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1899 |
#ifdef EFAULT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1900 |
case EFAULT: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1901 |
msg = "Bad address"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1902 |
sym = @symbol(EFAULT); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1903 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1904 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1905 |
#ifdef EBUSY |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1906 |
case EBUSY: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1907 |
msg = "Device or resource busy"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1908 |
sym = @symbol(EBUSY); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1909 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1910 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1911 |
#ifdef EEXIST |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1912 |
case EEXIST: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1913 |
msg = "File exists"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1914 |
sym = @symbol(EEXIST); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1915 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1916 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1917 |
#ifdef EXDEV |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1918 |
case EXDEV: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1919 |
msg = "Cross-device link"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1920 |
sym = @symbol(EXDEV); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1921 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1922 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1923 |
#ifdef ENODEV |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1924 |
case ENODEV: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1925 |
msg = "No such device"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1926 |
sym = @symbol(ENODEV); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1927 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1928 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1929 |
#ifdef ENOTDIR |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1930 |
case ENOTDIR: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1931 |
msg = "Not a directory"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1932 |
sym = @symbol(ENOTDIR); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1933 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1934 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1935 |
#ifdef EISDIR |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1936 |
case EISDIR: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1937 |
msg = "Is a directory"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1938 |
sym = @symbol(EISDIR); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1939 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1940 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1941 |
#ifdef EINVAL |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1942 |
case EINVAL: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1943 |
msg = "Invalid argument"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1944 |
sym = @symbol(EINVAL); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1945 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1946 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1947 |
#ifdef ENFILE |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1948 |
case ENFILE: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1949 |
msg = "File table overflow"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1950 |
sym = @symbol(ENFILE); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1951 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1952 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1953 |
#ifdef EMFILE |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1954 |
case EMFILE: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1955 |
msg = "Too many open files"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1956 |
sym = @symbol(EMFILE); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1957 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1958 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1959 |
#ifdef ENOTTY |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1960 |
case ENOTTY: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1961 |
msg = "Not a typewriter"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1962 |
sym = @symbol(ENOTTY); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1963 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1964 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1965 |
#ifdef EFBIG |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1966 |
case EFBIG: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1967 |
msg = "File too large"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1968 |
sym = @symbol(EFBIG); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1969 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1970 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1971 |
#ifdef ENOSPC |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1972 |
case ENOSPC: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1973 |
msg = "No space left on device"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1974 |
sym = @symbol(ENOSPC); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1975 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1976 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1977 |
#ifdef ESPIPE |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1978 |
case ESPIPE: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1979 |
msg = "Illegal seek"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1980 |
sym = @symbol(ESPIPE); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1981 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1982 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1983 |
#ifdef EROFS |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1984 |
case EROFS: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1985 |
msg = "Read-only file system"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1986 |
sym = @symbol(EROFS); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1987 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1988 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1989 |
#ifdef EMLINK |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1990 |
case EMLINK: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1991 |
msg = "Too many links"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1992 |
sym = @symbol(EMLINK); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1993 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1994 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1995 |
#ifdef EPIPE |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1996 |
case EPIPE: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1997 |
msg = "Broken pipe"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1998 |
sym = @symbol(EPIPE); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1999 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2000 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2001 |
#ifdef EDOM |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2002 |
case EDOM: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2003 |
msg = "Math argument out of domain"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2004 |
sym = @symbol(EDOM); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2005 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2006 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2007 |
#ifdef ERANGE |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2008 |
case ERANGE: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2009 |
msg = "Math result not representable"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2010 |
sym = @symbol(ERANGE); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2011 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2012 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2013 |
#ifdef EDEADLK |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2014 |
# if EDEADLK != EWOULDBLOCK |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2015 |
case EDEADLK: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2016 |
msg = "Resource deadlock would occur"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2017 |
sym = @symbol(EDEADLK); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2018 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2019 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2020 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2021 |
#ifdef ENAMETOOLONG |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2022 |
case ENAMETOOLONG: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2023 |
msg = "File name too long"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2024 |
sym = @symbol(ENAMETOOLONG); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2025 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2026 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2027 |
#ifdef ENOLCK |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2028 |
case ENOLCK: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2029 |
msg = "No record locks available"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2030 |
sym = @symbol(ENOLCK); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2031 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2032 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2033 |
#ifdef ENOSYS |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2034 |
case ENOSYS: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2035 |
msg = "Function not implemented"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2036 |
sym = @symbol(ENOSYS); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2037 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2038 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2039 |
#if defined(ENOTEMPTY) && (ENOTEMPTY != EEXIST) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2040 |
case ENOTEMPTY: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2041 |
msg = "Directory not empty"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2042 |
sym = @symbol(ENOTEMPTY); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2043 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2044 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2045 |
#ifdef EILSEQ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2046 |
case EILSEQ: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2047 |
msg = "Illegal byte sequence"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2048 |
sym = @symbol(EILSEQ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2049 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2050 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2051 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2052 |
* XPG3 errnos - defined on most systems |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2053 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2054 |
#ifdef ENOTBLK |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2055 |
case ENOTBLK: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2056 |
msg = "Block device required"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2057 |
sym = @symbol(ENOTBLK); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2058 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2059 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2060 |
#ifdef ETXTBSY |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2061 |
case ETXTBSY: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2062 |
msg = "Text file busy"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2063 |
sym = @symbol(ETXTBSY); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2064 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2065 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2066 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2067 |
* some others |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2068 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2069 |
#ifdef EWOULDBLOCK |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2070 |
case EWOULDBLOCK: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2071 |
msg = "Operation would block"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2072 |
sym = @symbol(EWOULDBLOCK); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2073 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2074 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2075 |
#ifdef ENOMSG |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2076 |
case ENOMSG: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2077 |
msg = "No message of desired type"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2078 |
sym = @symbol(ENOMSG); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2079 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2080 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2081 |
#ifdef ELOOP |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2082 |
case ELOOP: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2083 |
msg = "Too many levels of symbolic links"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2084 |
sym = @symbol(ELOOP); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2085 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2086 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2087 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2088 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2089 |
* some stream errors |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2090 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2091 |
#ifdef ETIME |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2092 |
case ETIME: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2093 |
msg = "Timer expired"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2094 |
sym = @symbol(ETIME); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2095 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2096 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2097 |
#ifdef ENOSR |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2098 |
case ENOSR: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2099 |
msg = "Out of streams resources"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2100 |
sym = @symbol(ENOSR); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2101 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2102 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2103 |
#ifdef ENOSTR |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2104 |
case ENOSTR: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2105 |
msg = "Device not a stream"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2106 |
sym = @symbol(ENOSTR); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2107 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2108 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2109 |
#ifdef ECOMM |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2110 |
case ECOMM: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2111 |
msg = "Communication error on send"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2112 |
sym = @symbol(ECOMM); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2113 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2114 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2115 |
#ifdef EPROTO |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2116 |
case EPROTO: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2117 |
msg = "Protocol error"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2118 |
sym = @symbol(EPROTO); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2119 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2120 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2121 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2122 |
* nfs errors |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2123 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2124 |
#ifdef ESTALE |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2125 |
case ESTALE: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2126 |
msg = "Stale NFS file handle"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2127 |
sym = @symbol(ESTALE); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2128 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2129 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2130 |
#ifdef EREMOTE |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2131 |
case EREMOTE: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2132 |
msg = "Too many levels of remote in path"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2133 |
sym = @symbol(EREMOTE); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2134 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2135 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2136 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2137 |
* some networking errors |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2138 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2139 |
#ifdef EINPROGRESS |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2140 |
case EINPROGRESS: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2141 |
msg = "Operation now in progress"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2142 |
sym = @symbol(EINPROGRESS); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2143 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2144 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2145 |
#ifdef EALREADY |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2146 |
case EALREADY: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2147 |
msg = "Operation already in progress"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2148 |
sym = @symbol(EALREADY); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2149 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2150 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2151 |
#ifdef ENOTSOCK |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2152 |
case ENOTSOCK: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2153 |
msg = "Socket operation on non-socket"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2154 |
sym = @symbol(ENOTSOCK); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2155 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2156 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2157 |
#ifdef EDESTADDRREQ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2158 |
case EDESTADDRREQ: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2159 |
msg = "Destination address required"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2160 |
sym = @symbol(EDESTADDRREQ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2161 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2162 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2163 |
#ifdef EMSGSIZE |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2164 |
case EMSGSIZE: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2165 |
msg = "Message too long"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2166 |
sym = @symbol(EMSGSIZE); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2167 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2168 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2169 |
#ifdef EPROTOTYPE |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2170 |
case EPROTOTYPE: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2171 |
msg = "Protocol wrong type for socket"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2172 |
sym = @symbol(EPROTOTYPE); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2173 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2174 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2175 |
#ifdef ENOPROTOOPT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2176 |
case ENOPROTOOPT: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2177 |
msg = "Protocol not available"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2178 |
sym = @symbol(ENOPROTOOPT); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2179 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2180 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2181 |
#ifdef EPROTONOSUPPORT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2182 |
case EPROTONOSUPPORT: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2183 |
msg = "Protocol not supported"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2184 |
sym = @symbol(EPROTONOSUPPORT); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2185 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2186 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2187 |
#ifdef ESOCKTNOSUPPORT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2188 |
case ESOCKTNOSUPPORT: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2189 |
msg = "Socket type not supported"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2190 |
sym = @symbol(ESOCKTNOSUPPORT); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2191 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2192 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2193 |
#ifdef EOPNOTSUPP |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2194 |
case EOPNOTSUPP: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2195 |
msg = "Operation not supported on socket"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2196 |
sym = @symbol(EOPNOTSUPP); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2197 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2198 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2199 |
#ifdef EPFNOSUPPORT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2200 |
case EPFNOSUPPORT: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2201 |
msg = "Protocol family not supported"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2202 |
sym = @symbol(EPFNOSUPPORT); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2203 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2204 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2205 |
#ifdef EAFNOSUPPORT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2206 |
case EAFNOSUPPORT: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2207 |
msg = "Address family not supported by protocol family"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2208 |
sym = @symbol(EAFNOSUPPORT); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2209 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2210 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2211 |
#ifdef EADDRINUSE |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2212 |
case EADDRINUSE: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2213 |
msg = "Address already in use"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2214 |
sym = @symbol(EADDRINUSE); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2215 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2216 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2217 |
#ifdef EADDRNOTAVAIL |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2218 |
case EADDRNOTAVAIL: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2219 |
msg = "Can\'t assign requested address"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2220 |
sym = @symbol(EADDRNOTAVAIL); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2221 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2222 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2223 |
#ifdef ETIMEDOUT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2224 |
case ETIMEDOUT: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2225 |
msg = "Connection timed out"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2226 |
sym = @symbol(ETIMEDOUT); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2227 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2228 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2229 |
#ifdef ECONNREFUSED |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2230 |
case ECONNREFUSED: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2231 |
msg = "Connection refused"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2232 |
sym = @symbol(ECONNREFUSED); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2233 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2234 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2235 |
#ifdef ENETDOWN |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2236 |
case ENETDOWN: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2237 |
msg = "Network is down"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2238 |
sym = @symbol(ENETDOWN); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2239 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2240 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2241 |
#ifdef ENETUNREACH |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2242 |
case ENETUNREACH: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2243 |
msg = "Network is unreachable"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2244 |
sym = @symbol(ENETUNREACH); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2245 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2246 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2247 |
#ifdef ENETRESET |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2248 |
case ENETRESET: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2249 |
msg = "Network dropped conn due to reset"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2250 |
sym = @symbol(ENETRESET); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2251 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2252 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2253 |
#ifdef ECONNABORTED |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2254 |
case ECONNABORTED: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2255 |
msg = "Software caused connection abort"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2256 |
sym = @symbol(ECONNABORTED); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2257 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2258 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2259 |
#ifdef ECONNRESET |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2260 |
case ECONNRESET: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2261 |
msg = "Connection reset by peer"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2262 |
sym = @symbol(ECONNRESET); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2263 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2264 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2265 |
#ifdef EISCONN |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2266 |
case EISCONN: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2267 |
msg = "Socket is already connected"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2268 |
sym = @symbol(EISCONN); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2269 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2270 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2271 |
#ifdef ENOTCONN |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2272 |
case ENOTCONN: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2273 |
msg = "Socket is not connected"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2274 |
sym = @symbol(ENOTCONN); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2275 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2276 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2277 |
#ifdef ESHUTDOWN |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2278 |
case ESHUTDOWN: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2279 |
msg = "Can't send after socket shutdown"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2280 |
sym = @symbol(ESHUTDOWN); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2281 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2282 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2283 |
#ifdef EHOSTDOWN |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2284 |
case EHOSTDOWN: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2285 |
msg = "Host is down"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2286 |
sym = @symbol(EHOSTDOWN); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2287 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2288 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2289 |
#ifdef EHOSTUNREACH |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2290 |
case EHOSTUNREACH: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2291 |
msg = "No route to host"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2292 |
sym = @symbol(EHOSTUNREACH); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2293 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2294 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2295 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2296 |
default: |
3861
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
2297 |
sym = nil; |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2298 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2299 |
} |
3861
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
2300 |
} |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
2301 |
if (sym == nil) { |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
2302 |
sprintf(buffer, "ErrorNr: %d", __eno); |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
2303 |
msg = buffer; |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
2304 |
sym = @symbol(ERROR_OTHER); |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
2305 |
} |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
2306 |
text = __MKSTRING(msg); |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2307 |
} else { |
3861
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
2308 |
text = nil; |
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
2309 |
sym = nil; |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2310 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2311 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2312 |
^ Array with:sym with:text |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2313 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2314 |
" |
3796 | 2315 |
OperatingSystem errorSymbolAndTextForNumber:4 |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2316 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2317 |
! ! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2318 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2319 |
!Win32OperatingSystem class methodsFor:'executing OS commands'! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2320 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2321 |
commandAndArgsForOSCommand:aCommandString |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2322 |
"get a shell and shell arguments for command execution" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2323 |
|
3820 | 2324 |
|shell args wDir path words hasRedirection| |
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
2325 |
|
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
2326 |
"/ |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
2327 |
"/ 'x:\WINNT\System32\cmd /c <command>' |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
2328 |
"/ or 'x:\WINDOWS\System32\cmd /c <command>' |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
2329 |
"/ or 'x:\WINDOWS\System\cmd /c <command>' |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
2330 |
"/ or whatever ... |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
2331 |
"/ |
3820 | 2332 |
|
3831 | 2333 |
"/ to workaround a bug in win95's command.com |
2334 |
"/ (which always returns a 0-exit code |
|
2335 |
"/ - even if the command failed), |
|
2336 |
"/ Here, we see if the command is found along the path and |
|
3820 | 2337 |
"/ call it directly if found. |
2338 |
"/ If not found, assume its a builtIn or batch command |
|
2339 |
"/ and pass it to command.com. |
|
3831 | 2340 |
"/ Also use command.com, if any I/O redirection is |
2341 |
"/ involved, since that is (not yet) handled here. |
|
2342 |
"/ |
|
3820 | 2343 |
"/ I know: this is a kludge but should work for now... |
3831 | 2344 |
"/ ...this will change in an upcoming version to include |
2345 |
"/ command.com command-line parsing here (sigh). |
|
2346 |
||
3837 | 2347 |
hasRedirection := false. |
2348 |
(aCommandString includesAny:'<>|') ifTrue:[ |
|
2349 |
hasRedirection := true |
|
2350 |
] ifFalse:[ |
|
2351 |
words := aCommandString asCollectionOfSubstringsSeparatedBy:Character space. |
|
2352 |
args := ' '. |
|
2353 |
words from:2 to:(words size) do:[:s | |
|
2354 |
args := args , (s , ' '). |
|
2355 |
]. |
|
2356 |
]. |
|
2357 |
||
2358 |
"/ I/O redirection is not yet handled directly |
|
2359 |
"/ fallBack to command.com (below) to do it. |
|
2360 |
||
2361 |
hasRedirection ifFalse:[ |
|
2362 |
path := self pathOfCommand:(words at:1). |
|
2363 |
path notNil ifTrue:[ |
|
2364 |
"/ execute the command directly - |
|
2365 |
"/ without going through command.com |
|
2366 |
||
2367 |
self isMSWINDOWSNTlike ifTrue:[ |
|
2368 |
args := path , args. |
|
2369 |
]. |
|
2370 |
||
2371 |
^ Array with:path with:args |
|
2372 |
]. |
|
3820 | 2373 |
]. |
3831 | 2374 |
|
2375 |
"/ windows-NT (where command.com works) |
|
2376 |
"/ or I/O redirection or no executable was found |
|
2377 |
||
3741 | 2378 |
shell := self getEnvironment:'COMSPEC'. |
2379 |
shell isNil ifTrue:[ |
|
3837 | 2380 |
wDir := self getWindowsSystemDirectory asFilename. |
2381 |
shell := (wDir construct:'cmd.exe'). |
|
2382 |
shell exists ifFalse:[ |
|
2383 |
shell := (wDir construct:'command.com'). |
|
2384 |
shell exists ifFalse:[ |
|
2385 |
self error:'no command.com available'. |
|
2386 |
] |
|
2387 |
]. |
|
2388 |
shell := shell pathName. |
|
3741 | 2389 |
]. |
3819 | 2390 |
|
3820 | 2391 |
shell := shell , ' /c '. |
2392 |
||
2393 |
^ Array with:shell with:aCommandString |
|
3821 | 2394 |
|
3820 | 2395 |
"Modified: / 20.1.1998 / 16:57:19 / md" |
3831 | 2396 |
"Modified: / 11.9.1998 / 19:03:55 / cg" |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2397 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2398 |
|
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2399 |
exec:aCommandPath withArguments:argArray fileDescriptors:fdArray closeDescriptors:closeFdArray fork:doFork newPgrp:newPgrp inDirectory:aDirectory |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2400 |
"Internal lowLevel entry for combined fork & exec for WIN32 |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2401 |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2402 |
If fork is false (chain a command): |
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2403 |
execute the OS command specified by the argument, aCommandPath, with |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2404 |
arguments in argArray (no arguments, if nil). |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2405 |
If successful, this method does not return and smalltalk is gone. |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2406 |
If not successful, it does return. |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2407 |
Normal use is with forkForCommand. |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2408 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2409 |
If fork is true (subprocess command execution): |
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2410 |
fork a child to do the above. |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2411 |
The process id of the child process is returned; nil if the fork failed. |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2412 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2413 |
fdArray contains the filedescriptors, to be used for the child (if fork is true). |
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2414 |
fdArray[1] = 15 -> use fd 15 as stdin. |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2415 |
If an element of the array is set to nil, the corresponding filedescriptor |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2416 |
will be closed for the child. |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2417 |
fdArray[0] == StdIn for child |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2418 |
fdArray[1] == StdOut for child |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2419 |
fdArray[2] == StdErr for child |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2420 |
on VMS, these must be channels as returned by createMailBox. |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2421 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2422 |
closeFdArray contains descriptors that will be closed in the subprocess. |
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2423 |
closeDescriptors are ignored in the WIN32 & VMS versions. |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2424 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2425 |
NOTE that in WIN32 the fds are HANDLES!! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2426 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2427 |
If newPgrp is true, the subprocess will be established in a new process group. |
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2428 |
The processgroup will be equal to id. |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2429 |
newPgrp is not used on WIN32 and VMS systems." |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2430 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2431 |
|path| |
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2432 |
|
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2433 |
aDirectory notNil ifTrue:[ |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2434 |
path := aDirectory asFilename asAbsoluteFilename osNameForDirectory. |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2435 |
(path endsWith:':') ifTrue:[ |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2436 |
path := path , '\'. |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2437 |
]. |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2438 |
]. |
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2439 |
|
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2440 |
^ self |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2441 |
primExec:aCommandPath |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2442 |
withArguments:argArray |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2443 |
fileDescriptors:fdArray |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2444 |
closeDescriptors:closeFdArray |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2445 |
fork:doFork |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2446 |
newPgrp:newPgrp |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2447 |
inPath:path |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2448 |
|
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2449 |
"Modified: / 31.1.1998 / 10:54:24 / md" |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2450 |
"Modified: / 10.11.1998 / 20:44:24 / cg" |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2451 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2452 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2453 |
getStatusOfProcess:aProcessId |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2454 |
"wait for a process to terminate and fetch its exit status. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2455 |
This is required to avoid zombie processes." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2456 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2457 |
%{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2458 |
DWORD endStatus; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2459 |
int status = -1; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2460 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2461 |
if (__isExternalAddress(aProcessId) ) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2462 |
{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2463 |
HANDLE handle = _HANDLEVal(aProcessId); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2464 |
if (handle) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2465 |
{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2466 |
endStatus = WaitForSingleObject(handle , INFINITE ); |
3741 | 2467 |
if ( endStatus != WAIT_FAILED ) |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2468 |
{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2469 |
if (GetExitCodeProcess(handle,&endStatus)) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2470 |
{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2471 |
status = endStatus; |
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2472 |
printf("getexitcode status = %d\n",status); |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2473 |
} |
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2474 |
else |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2475 |
printf("getexitcode failed.\n"); |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2476 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2477 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2478 |
RETURN ( __MKSMALLINT(status)); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2479 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2480 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2481 |
self primitiveFailed |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2482 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2483 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2484 |
pathOfCommand:aCommand |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2485 |
"find where aCommand's executable file is; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2486 |
return its full pathName if there is such a command, otherwise |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2487 |
return nil." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2488 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2489 |
|path f fExt| |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2490 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2491 |
aCommand asFilename isAbsolute ifTrue:[ |
3821 | 2492 |
^ aCommand |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2493 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2494 |
|
3819 | 2495 |
path := self getEnvironment:'PATH'. |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2496 |
path notNil ifTrue:[ |
3821 | 2497 |
(path asCollectionOfSubstringsSeparatedBy:(self pathSeparator)) do:[:path | |
2498 |
path isEmpty ifTrue:[ |
|
2499 |
f := aCommand asFilename |
|
2500 |
] ifFalse:[ |
|
2501 |
f := path asFilename construct:aCommand. |
|
2502 |
]. |
|
2503 |
self executableFileExtensions do:[:ext | |
|
2504 |
ext notEmpty ifTrue:[ |
|
2505 |
fExt := (f pathName , '.' , ext) asFilename. |
|
2506 |
] ifFalse:[ |
|
2507 |
fExt := f. |
|
2508 |
]. |
|
2509 |
fExt isExecutable ifTrue:[ |
|
2510 |
^ fExt pathName |
|
2511 |
]. |
|
2512 |
]. |
|
2513 |
]. |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2514 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2515 |
^ nil |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2516 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2517 |
"windows: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2518 |
|
3819 | 2519 |
OperatingSystem pathOfCommand:'bcc32' |
2520 |
" |
|
2521 |
||
2522 |
"Modified: / 10.9.1998 / 17:51:49 / cg" |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2523 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2524 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2525 |
primExec:aCommandPath withArguments:argArray fileDescriptors:fdArray closeDescriptors:closeFdArray fork:doFork newPgrp:newPgrp inPath:dirName |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2526 |
"Internal lowLevel entry for combined fork & exec for WIN32" |
3741 | 2527 |
%{ /* xxLIMITEDSTACK(WIN32) */ |
3810 | 2528 |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2529 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2530 |
* if fork is false, chain to another command (not yet supported) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2531 |
* otherwise, spawn a subprocess and let it execute the command. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2532 |
* Currently, only the forking version is supported (who chains anyway ?) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2533 |
*/ |
3741 | 2534 |
char fullCmdPathBuffer[1024]; |
2535 |
char fullCmdLine[4096]; |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2536 |
char fullDirName[1024]; |
3741 | 2537 |
char *fullCmdPath = fullCmdPathBuffer; |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2538 |
char *dir = 0; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2539 |
DWORD fdwCreate = 0; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2540 |
STARTUPINFO lpsiStartInfo; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2541 |
PROCESS_INFORMATION lppiProcInfo; |
3741 | 2542 |
SECURITY_ATTRIBUTES process; |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2543 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2544 |
if (__isString(dirName)) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2545 |
{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2546 |
strcpy( fullDirName, __stringVal(dirName) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2547 |
dir = fullDirName; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2548 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2549 |
if (__isString(aCommandPath) && __isString(argArray)){ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2550 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2551 |
* generate command line (cmd plus args) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2552 |
*/ |
3741 | 2553 |
|
2554 |
if (__isWinNT) |
|
2555 |
{ |
|
2556 |
char *d; |
|
2557 |
strcpy( fullCmdPath, __stringVal(aCommandPath) ); |
|
2558 |
d = strchr(fullCmdPath,' '); |
|
2559 |
if (d) |
|
2560 |
{ |
|
2561 |
*d++ = 0; |
|
2562 |
strcpy( fullCmdLine, d); |
|
2563 |
} |
|
2564 |
else |
|
2565 |
strcpy( fullCmdLine, ""); |
|
2566 |
} |
|
2567 |
else |
|
2568 |
{ |
|
3828
18ba9b3f03fa
added isWINDOWSNTlike query;
Claus Gittinger <cg@exept.de>
parents:
3822
diff
changeset
|
2569 |
//fullCmdPath = 0; |
18ba9b3f03fa
added isWINDOWSNTlike query;
Claus Gittinger <cg@exept.de>
parents:
3822
diff
changeset
|
2570 |
strcpy( fullCmdPath,"stxspawn.exe"); |
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2571 |
strcpy( fullCmdLine,"stxspawn.exe "); |
3741 | 2572 |
strcat( fullCmdLine, __stringVal(aCommandPath)); |
3828
18ba9b3f03fa
added isWINDOWSNTlike query;
Claus Gittinger <cg@exept.de>
parents:
3822
diff
changeset
|
2573 |
//strcpy( fullCmdLine, __stringVal(aCommandPath)); |
3741 | 2574 |
} |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2575 |
strcat( fullCmdLine, __stringVal(argArray) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2576 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2577 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2578 |
* create descriptors as req'd |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2579 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2580 |
process.nLength = sizeof( process ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2581 |
process.lpSecurityDescriptor = NULL; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2582 |
process.bInheritHandle = TRUE; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2583 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2584 |
lpsiStartInfo.cb = sizeof(PROCESS_INFORMATION); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2585 |
lpsiStartInfo.lpReserved = NULL; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2586 |
lpsiStartInfo.lpDesktop = NULL; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2587 |
lpsiStartInfo.lpTitle = NULL; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2588 |
lpsiStartInfo.dwX = 0; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2589 |
lpsiStartInfo.dwY = 0; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2590 |
lpsiStartInfo.dwXSize = 100; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2591 |
lpsiStartInfo.dwYSize = 100; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2592 |
lpsiStartInfo.dwXCountChars = 0; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2593 |
lpsiStartInfo.dwYCountChars = 0; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2594 |
lpsiStartInfo.dwFillAttribute = 0; |
3741 | 2595 |
if (0/*__isWinNT*/) |
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2596 |
{ |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2597 |
lpsiStartInfo.dwFlags = STARTF_USESTDHANDLES; |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2598 |
lpsiStartInfo.wShowWindow = SW_SHOWDEFAULT; |
3741 | 2599 |
} |
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2600 |
else |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2601 |
{ |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2602 |
lpsiStartInfo.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES /*| STARTF_USEPOSITION*/; |
3741 | 2603 |
lpsiStartInfo.wShowWindow = SW_HIDE /*SW_SHOWDEFAULT*/; |
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2604 |
} |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2605 |
lpsiStartInfo.cbReserved2 = 0; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2606 |
lpsiStartInfo.lpReserved2 = NULL; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2607 |
lpsiStartInfo.hStdInput = NULL; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2608 |
lpsiStartInfo.hStdOutput = NULL; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2609 |
lpsiStartInfo.hStdError = NULL; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2610 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2611 |
/* set create process flags */ |
3741 | 2612 |
if (__isWinNT) |
2613 |
fdwCreate = 0; //IDLE_PRIORITY_CLASS; |
|
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2614 |
else |
3741 | 2615 |
fdwCreate = CREATE_NEW_CONSOLE; //|IDLE_PRIORITY_CLASS; // DETACHED_PROCESS; // NORMAL_PRIORITY_CLASS ; |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2616 |
if( newPgrp == true ) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2617 |
fdwCreate |= CREATE_NEW_PROCESS_GROUP; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2618 |
} |
3810 | 2619 |
if ( fdArray == nil ) { |
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2620 |
lpsiStartInfo.hStdInput = (HANDLE) _get_osfhandle (0); |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2621 |
lpsiStartInfo.hStdOutput = (HANDLE) _get_osfhandle (1); |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2622 |
lpsiStartInfo.hStdError = (HANDLE) _get_osfhandle (2); |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2623 |
} |
3741 | 2624 |
else if( __isArray(fdArray) |
3802 | 2625 |
&& ( __arraySize(fdArray) == 3 ) ) |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2626 |
{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2627 |
HANDLE self = GetCurrentProcess (); |
3741 | 2628 |
if (__ArrayInstPtr(fdArray)->a_element[0] != nil) |
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2629 |
{ |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2630 |
if (__isExternalAddress(__ArrayInstPtr(fdArray)->a_element[0]) ) |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2631 |
{ |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2632 |
lpsiStartInfo.hStdInput = _HANDLEVal(__ArrayInstPtr(fdArray)->a_element[0]); |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2633 |
} |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2634 |
else |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2635 |
{ |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2636 |
lpsiStartInfo.hStdInput = (HANDLE) _get_osfhandle (__intVal(__ArrayInstPtr(fdArray)->a_element[0])); |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2637 |
} |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2638 |
} |
3741 | 2639 |
if (__ArrayInstPtr(fdArray)->a_element[1] != nil) |
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2640 |
{ |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2641 |
if (__isExternalAddress(__ArrayInstPtr(fdArray)->a_element[1]) ) { |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2642 |
lpsiStartInfo.hStdOutput = _HANDLEVal(__ArrayInstPtr(fdArray)->a_element[1]); |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2643 |
} |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2644 |
else |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2645 |
{ |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2646 |
lpsiStartInfo.hStdOutput = (HANDLE) _get_osfhandle (__intVal(__ArrayInstPtr(fdArray)->a_element[1])); |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2647 |
} |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2648 |
} |
3741 | 2649 |
if (__ArrayInstPtr(fdArray)->a_element[2] != nil) |
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2650 |
{ |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2651 |
if (__isExternalAddress(__ArrayInstPtr(fdArray)->a_element[2]) ) { |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2652 |
lpsiStartInfo.hStdError = _HANDLEVal(__ArrayInstPtr(fdArray)->a_element[2]); |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2653 |
} |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2654 |
else |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2655 |
{ |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2656 |
lpsiStartInfo.hStdError = (HANDLE) _get_osfhandle (__intVal(__ArrayInstPtr(fdArray)->a_element[2])); |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2657 |
} |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
2658 |
} |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2659 |
#ifdef PROCESSDEBUGWIN32 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2660 |
printf("stdin %x\n",lpsiStartInfo.hStdInput); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2661 |
printf("stdout %x\n",lpsiStartInfo.hStdOutput); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2662 |
printf("stderr %x\n",lpsiStartInfo.hStdError); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2663 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2664 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2665 |
if (doFork == true) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2666 |
{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2667 |
#ifdef PROCESSDEBUGWIN32 |
3828
18ba9b3f03fa
added isWINDOWSNTlike query;
Claus Gittinger <cg@exept.de>
parents:
3822
diff
changeset
|
2668 |
printf( "create process >%s< >%s< in >%s<\n", fullCmdPath,fullCmdLine,dir); |
3741 | 2669 |
#endif |
2670 |
if( CreateProcess( fullCmdPath, |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2671 |
fullCmdLine, |
3741 | 2672 |
&process,&process, |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2673 |
TRUE, |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2674 |
fdwCreate, |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2675 |
NULL, |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2676 |
dir, |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2677 |
&lpsiStartInfo, |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2678 |
&lppiProcInfo ) ) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2679 |
{ |
3741 | 2680 |
CloseHandle(lppiProcInfo.hThread); |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2681 |
#ifdef PROCESSDEBUGWIN32 |
3741 | 2682 |
printf( "created process hProcess=%x\n", lppiProcInfo.hProcess); |
2683 |
#endif |
|
2684 |
RETURN (__MKEXTERNALADDRESS(lppiProcInfo.hProcess)); |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2685 |
} |
3741 | 2686 |
#ifdef PROCESSDEBUGWIN32 |
2687 |
printf( "created process error %d\n", GetLastError()); |
|
2688 |
#endif |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2689 |
RETURN (nil); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2690 |
} else { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2691 |
; /* should never be called that way */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2692 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2693 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2694 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2695 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2696 |
path-argument not string |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2697 |
or argArray not an array/nil |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2698 |
or malloc failed |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2699 |
or not supported by OS |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2700 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2701 |
^ self primitiveFailed |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2702 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2703 |
|
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2704 |
startProcess:aCommandString inputFrom:anExternalInStream outputTo:anExternalOutStream errorTo:anExternalErrStream inDirectory:dirOrNil |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2705 |
"start executing the OS command as specified by the argument, aCommandString |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2706 |
as a separate process; do not wait for the command to finish. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2707 |
The commandString is passed to a shell for execution - see the description of |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2708 |
'sh -c' in your UNIX manual ('cmd.com' in your MSDOS manual). |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2709 |
The command gets stdIn, stdOut and stdErr assigned from the arguments; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2710 |
each may be nil. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2711 |
Return the processId if successful, nil otherwise. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2712 |
Use #monitorPid:action: for synchronization and exec status return, |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2713 |
or #killProcess: to stop it." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2714 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2715 |
|in out err shellAndArgs| |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2716 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2717 |
anExternalInStream notNil ifTrue:[ |
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2718 |
in := anExternalInStream fileDescriptor. |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2719 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2720 |
anExternalOutStream notNil ifTrue:[ |
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2721 |
out := anExternalOutStream fileDescriptor. |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2722 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2723 |
anExternalErrStream notNil ifTrue:[ |
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2724 |
err := anExternalErrStream fileDescriptor. |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2725 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2726 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2727 |
shellAndArgs := self commandAndArgsForOSCommand:aCommandString. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2728 |
^ self |
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2729 |
exec:(shellAndArgs at:1) |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2730 |
withArguments:(shellAndArgs at:2) |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2731 |
fileDescriptors:(Array with:in with:out with:err) |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2732 |
closeDescriptors:nil |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2733 |
fork:true |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2734 |
newPgrp:false |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2735 |
inDirectory:dirOrNil |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2736 |
|
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2737 |
"Modified: / 10.11.1998 / 20:43:12 / cg" |
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
2738 |
"Created: / 10.11.1998 / 20:48:35 / cg" |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2739 |
! ! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2740 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2741 |
!Win32OperatingSystem class methodsFor:'file access'! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2742 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2743 |
closeFd:anInteger |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2744 |
"low level close of a filedescriptor" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2745 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2746 |
%{ |
3810 | 2747 |
if (__isExternalAddress(anInteger) ) { |
2748 |
if( !CloseHandle( anInteger ) ) { |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2749 |
fprintf( stderr, "Could not close handle : %d\n", anInteger); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2750 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2751 |
RETURN(self); |
3810 | 2752 |
} else { |
2753 |
if (__isSmallInteger(anInteger)) { |
|
2754 |
close(__intVal(anInteger)); |
|
2755 |
RETURN(self); |
|
2756 |
} |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2757 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2758 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2759 |
^ self primitiveFailed. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2760 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2761 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2762 |
createDirectory:aPathName |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2763 |
"create a new directory with name 'aPathName', which may be an absolute |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2764 |
path, or relative to the current directory. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2765 |
Return true if successful (or the directory existed already), false if failed. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2766 |
This is a low-level entry - use Filename protocol for compatibility." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2767 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2768 |
"/ if it already exists this is ok |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2769 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2770 |
(self isDirectory:aPathName) ifTrue:[^ true]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2771 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2772 |
%{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2773 |
if (__isString(aPathName)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2774 |
int ret; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2775 |
SECURITY_ATTRIBUTES sa; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2776 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2777 |
sa.nLength = sizeof( sa ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2778 |
sa.lpSecurityDescriptor = NULL; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2779 |
sa.bInheritHandle = TRUE; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2780 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2781 |
ret = CreateDirectory(__stringVal(aPathName), &sa); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2782 |
if (ret != TRUE) { |
3861
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
2783 |
@global(LastErrorNumber) = __MKSMALLINT(__WIN32_ERR(GetLastError())); |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2784 |
RETURN (false); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2785 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2786 |
RETURN (true); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2787 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2788 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2789 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2790 |
"/ self isUNIXlike ifTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2791 |
"/ ^ self executeCommand:('mkdir 2>/dev/null ', newPathName) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2792 |
"/ ]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2793 |
"/ ^ self executeCommand:('mkdir ', newPathName) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2794 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2795 |
self primitiveFailed |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2796 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2797 |
" |
3796 | 2798 |
OperatingSystem createDirectory:'foo' |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2799 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2800 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2801 |
"Modified: 20.12.1995 / 11:24:13 / stefan" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2802 |
"Modified: 29.6.1996 / 14:06:54 / cg" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2803 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2804 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2805 |
linkFile:oldPath to:newPath |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2806 |
"link the file 'oldPath' to 'newPath'. The link will be a hard link. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2807 |
Return true if successful, false if not." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2808 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2809 |
(oldPath isString not or:[newPath isString not]) ifTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2810 |
"/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2811 |
"/ bad argument(s) given |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2812 |
"/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2813 |
^ self primitiveFailed |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2814 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2815 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2816 |
"/ |
3796 | 2817 |
"/ this OperatingSystem does not support links |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2818 |
"/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2819 |
^ UnsupportedOperationSignal raise |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2820 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2821 |
" |
3796 | 2822 |
OperatingSystem linkFile:'foo' to:'bar' |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2823 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2824 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2825 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2826 |
recursiveCopyDirectory:sourcePathName to:destination |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2827 |
"copy the directory named 'sourcePathName' and all contained files/directories to 'destination'. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2828 |
Return true if successful." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2829 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2830 |
^ false |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2831 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2832 |
"Modified: / 4.6.1998 / 04:29:49 / cg" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2833 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2834 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2835 |
recursiveRemoveDirectory:fullPathName |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2836 |
"remove the directory named 'fullPathName' and all contained files/directories. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2837 |
Return true if successful." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2838 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2839 |
^ false. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2840 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2841 |
" |
3796 | 2842 |
OperatingSystem recursiveCreateDirectory:'foo/bar/baz' |
2843 |
OperatingSystem recursiveRemoveDirectory:'foo' |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2844 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2845 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2846 |
"Modified: 7.3.1996 / 15:26:30 / cg" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2847 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2848 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2849 |
removeDirectory:fullPathName |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2850 |
"remove the directory named 'fullPathName'. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2851 |
The directory must be empty and you must have appropriate access rights. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2852 |
Return true if successful, false if directory is not empty or no permission. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2853 |
This is a lowLevel entry - use Filename protocol for compatibility." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2854 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2855 |
%{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2856 |
int ret; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2857 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2858 |
if (__isString(fullPathName)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2859 |
ret = RemoveDirectory((char *) __stringVal(fullPathName)); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2860 |
if (ret != TRUE) { |
3861
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
2861 |
@global(LastErrorNumber) = __MKSMALLINT( __WIN32_ERR(GetLastError()) ); |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2862 |
RETURN (false); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2863 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2864 |
RETURN (true); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2865 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2866 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2867 |
"/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2868 |
"/ either not a string argument, |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2869 |
"/ or not supported by OS |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2870 |
"/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2871 |
^ self primitiveFailed |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2872 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2873 |
" |
3796 | 2874 |
OperatingSystem createDirectory:'foo' |
2875 |
OperatingSystem removeDirectory:'foo' |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2876 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2877 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2878 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2879 |
removeFile:fullPathName |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2880 |
"remove the file named 'fullPathName'; return true if successful. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2881 |
This is a lowLevel entry - use Filename protocol for compatibility." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2882 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2883 |
%{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2884 |
int ret; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2885 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2886 |
if (__isString(fullPathName)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2887 |
ret = DeleteFile((char *) __stringVal(fullPathName)); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2888 |
if (ret != TRUE) { |
3861
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
2889 |
@global(LastErrorNumber) = __MKSMALLINT( __WIN32_ERR(GetLastError()) ); |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2890 |
RETURN (false); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2891 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2892 |
RETURN (true); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2893 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2894 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2895 |
^ self primitiveFailed |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2896 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2897 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2898 |
renameFile:oldPath to:newPath |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2899 |
"rename the file 'oldPath' to 'newPath'. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2900 |
Someone else has to care for the names to be correct and |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2901 |
correct for the OS used - therefore, this should not be called |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2902 |
directlt. Instead, use Filename protocol to rename; this cares for |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2903 |
any invalid names. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2904 |
Returns true if successful, false if not" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2905 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2906 |
%{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2907 |
int ret, eno; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2908 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2909 |
if (__isString(oldPath) && __isString(newPath)) { |
3817
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
2910 |
#ifdef DO_WRAP_CALLS |
3779
6409bc73ce3c
copy all strings to a buffer when doing wrap-calls
Claus Gittinger <cg@exept.de>
parents:
3772
diff
changeset
|
2911 |
char _oldPath[MAXPATHLEN], _newPath[MAXPATHLEN]; |
6409bc73ce3c
copy all strings to a buffer when doing wrap-calls
Claus Gittinger <cg@exept.de>
parents:
3772
diff
changeset
|
2912 |
|
6409bc73ce3c
copy all strings to a buffer when doing wrap-calls
Claus Gittinger <cg@exept.de>
parents:
3772
diff
changeset
|
2913 |
strncpy(_oldPath, __stringVal(oldPath), MAXPATHLEN-1); _oldPath[MAXPATHLEN-1] = '\0'; |
6409bc73ce3c
copy all strings to a buffer when doing wrap-calls
Claus Gittinger <cg@exept.de>
parents:
3772
diff
changeset
|
2914 |
strncpy(_newPath, __stringVal(newPath), MAXPATHLEN-1); _newPath[MAXPATHLEN-1] = '\0'; |
6409bc73ce3c
copy all strings to a buffer when doing wrap-calls
Claus Gittinger <cg@exept.de>
parents:
3772
diff
changeset
|
2915 |
|
3741 | 2916 |
do { |
3822 | 2917 |
ret = __STX_C_CALL2( (void*)rename, (void *)_oldPath, (void *)_newPath); |
3741 | 2918 |
} while ((ret < 0) && (errno == EINTR)); |
3779
6409bc73ce3c
copy all strings to a buffer when doing wrap-calls
Claus Gittinger <cg@exept.de>
parents:
3772
diff
changeset
|
2919 |
|
3741 | 2920 |
if (ret < 0) { |
3861
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
2921 |
/*@global(LastErrorNumber) = __MKSMALLINT(__WIN32_ERR(GetLastError()));*/ |
3741 | 2922 |
@global(LastErrorNumber) = __MKSMALLINT(errno); |
2923 |
RETURN (false); |
|
2924 |
} |
|
2925 |
RETURN (true); |
|
2926 |
#else |
|
2927 |
||
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2928 |
#if defined(HAS_RENAME) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2929 |
__BEGIN_INTERRUPTABLE__ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2930 |
do { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2931 |
ret = rename((char *) __stringVal(oldPath), (char *) __stringVal(newPath)); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2932 |
} while (ret < 0 && errno == EINTR); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2933 |
__END_INTERRUPTABLE__ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2934 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2935 |
if (ret < 0) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2936 |
@global(LastErrorNumber) = __MKSMALLINT(errno); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2937 |
RETURN ( false ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2938 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2939 |
RETURN (true); |
3741 | 2940 |
#endif |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2941 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2942 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2943 |
^ self primitiveFailed |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2944 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2945 |
" |
3796 | 2946 |
OperatingSystem renameFile:'foo' to:'bar' |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2947 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2948 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2949 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2950 |
truncateFile:aPathName to:newSize |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2951 |
"change a files size return true on success, false on failure. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2952 |
This may not be supported on all architectures. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2953 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2954 |
This is a low-level entry - use Filename protocol." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2955 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2956 |
^ self primitiveFailed |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2957 |
! ! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2958 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2959 |
!Win32OperatingSystem class methodsFor:'file access rights'! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2960 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2961 |
accessMaskFor:aSymbol |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2962 |
"return the access bits mask for numbers as returned by |
3796 | 2963 |
OperatingSystem>>accessModeOf: |
2964 |
and expected by OperatingSystem>>changeAccessModeOf:to:. |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2965 |
Since these numbers are OS dependent, always use the mask |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2966 |
(never hardcode 8rxxx into your code)." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2967 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2968 |
%{ /* NOCONTEXT */ |
3572 | 2969 |
/* posix systems should define these ... */ |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2970 |
# ifndef S_IRUSR |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2971 |
# define S_IRUSR 0400 |
3572 | 2972 |
# endif |
2973 |
# ifndef S_IWUSR |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2974 |
# define S_IWUSR 0200 |
3572 | 2975 |
# endif |
2976 |
# ifndef S_IXUSR |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2977 |
# define S_IXUSR 0100 |
3572 | 2978 |
# endif |
2979 |
# ifndef S_IRGRP |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2980 |
# define S_IRGRP 0040 |
3572 | 2981 |
# endif |
2982 |
# ifndef S_IWGRP |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2983 |
# define S_IWGRP 0020 |
3572 | 2984 |
# endif |
2985 |
# ifndef S_IXGRP |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2986 |
# define S_IXGRP 0010 |
3572 | 2987 |
# endif |
2988 |
# ifndef S_IROTH |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2989 |
# define S_IROTH 0004 |
3572 | 2990 |
# endif |
2991 |
# ifndef S_IWOTH |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2992 |
# define S_IWOTH 0002 |
3572 | 2993 |
# endif |
2994 |
# ifndef S_IXOTH |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2995 |
# define S_IXOTH 0001 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2996 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2997 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2998 |
if (aSymbol == @symbol(readUser)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2999 |
RETURN ( __MKSMALLINT(S_IRUSR) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3000 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3001 |
if (aSymbol == @symbol(writeUser)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3002 |
RETURN ( __MKSMALLINT(S_IWUSR) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3003 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3004 |
if (aSymbol == @symbol(executeUser)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3005 |
RETURN ( __MKSMALLINT(S_IXUSR) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3006 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3007 |
if (aSymbol == @symbol(readGroup)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3008 |
RETURN ( __MKSMALLINT(S_IRGRP) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3009 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3010 |
if (aSymbol == @symbol(writeGroup)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3011 |
RETURN ( __MKSMALLINT(S_IWGRP) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3012 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3013 |
if (aSymbol == @symbol(executeGroup)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3014 |
RETURN ( __MKSMALLINT(S_IXGRP) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3015 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3016 |
if (aSymbol == @symbol(readOthers)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3017 |
RETURN ( __MKSMALLINT(S_IROTH) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3018 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3019 |
if (aSymbol == @symbol(writeOthers)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3020 |
RETURN ( __MKSMALLINT(S_IWOTH) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3021 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3022 |
if (aSymbol == @symbol(executeOthers)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3023 |
RETURN ( __MKSMALLINT(S_IXOTH) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3024 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3025 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3026 |
^ self primitiveFailed |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3027 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3028 |
" |
3796 | 3029 |
OperatingSystem accessMaskFor:#readUser |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3030 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3031 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3032 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3033 |
accessModeOf:aPathName |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3034 |
"return a number representing access rights rwxrwxrwx for owner, |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3035 |
group and others. Return nil if such a file does not exist. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3036 |
Notice that the returned number is OS dependent - use the |
3796 | 3037 |
modeMasks as returned by OperatingSystem>>accessMaskFor:" |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3038 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3039 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3040 |
this could have been implemented as: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3041 |
(self infoOf:aPathName) at:#mode |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3042 |
but for huge directory searches the code below is faster |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3043 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3044 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3045 |
%{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3046 |
struct stat buf; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3047 |
int ret; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3048 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3049 |
if (__isString(aPathName)) { |
3817
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3050 |
#ifdef DO_WRAP_CALLS |
3779
6409bc73ce3c
copy all strings to a buffer when doing wrap-calls
Claus Gittinger <cg@exept.de>
parents:
3772
diff
changeset
|
3051 |
char _aPathName[MAXPATHLEN]; |
6409bc73ce3c
copy all strings to a buffer when doing wrap-calls
Claus Gittinger <cg@exept.de>
parents:
3772
diff
changeset
|
3052 |
|
6409bc73ce3c
copy all strings to a buffer when doing wrap-calls
Claus Gittinger <cg@exept.de>
parents:
3772
diff
changeset
|
3053 |
strncpy(_aPathName, __stringVal(aPathName), MAXPATHLEN-1); _aPathName[MAXPATHLEN-1] = '\0'; |
6409bc73ce3c
copy all strings to a buffer when doing wrap-calls
Claus Gittinger <cg@exept.de>
parents:
3772
diff
changeset
|
3054 |
|
3741 | 3055 |
do { |
3822 | 3056 |
ret = __STX_C_CALL2( (void*)stat, (void *)_aPathName, (void *) &buf); |
3741 | 3057 |
} while ((ret < 0) && (errno == EINTR)); |
3058 |
#else |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3059 |
__BEGIN_INTERRUPTABLE__ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3060 |
do { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3061 |
ret = stat((char *) __stringVal(aPathName), &buf); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3062 |
} while ((ret < 0) && (errno == EINTR)); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3063 |
__END_INTERRUPTABLE__ |
3741 | 3064 |
#endif |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3065 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3066 |
if (ret < 0) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3067 |
@global(LastErrorNumber) = __MKSMALLINT(errno); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3068 |
RETURN ( nil ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3069 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3070 |
RETURN ( __MKSMALLINT(buf.st_mode & 0777) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3071 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3072 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3073 |
^ self primitiveFailed |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3074 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3075 |
" |
3796 | 3076 |
(OperatingSystem accessModeOf:'/') printStringRadix:8 |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3077 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3078 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3079 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3080 |
changeAccessModeOf:aPathName to:modeBits |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3081 |
"change the access rights of aPathName to the OS dependent modeBits. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3082 |
You should construct this mask using accessMaskFor, to be OS |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3083 |
independent. Return true if changed, |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3084 |
false if such a file does not exist or change was not allowd." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3085 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3086 |
%{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3087 |
int ret; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3088 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3089 |
if (__isString(aPathName) && __isSmallInteger(modeBits)) { |
3817
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3090 |
#ifdef DO_WRAP_CALLS |
3779
6409bc73ce3c
copy all strings to a buffer when doing wrap-calls
Claus Gittinger <cg@exept.de>
parents:
3772
diff
changeset
|
3091 |
int chmod(); |
6409bc73ce3c
copy all strings to a buffer when doing wrap-calls
Claus Gittinger <cg@exept.de>
parents:
3772
diff
changeset
|
3092 |
char _aPathName[MAXPATHLEN]; |
6409bc73ce3c
copy all strings to a buffer when doing wrap-calls
Claus Gittinger <cg@exept.de>
parents:
3772
diff
changeset
|
3093 |
|
6409bc73ce3c
copy all strings to a buffer when doing wrap-calls
Claus Gittinger <cg@exept.de>
parents:
3772
diff
changeset
|
3094 |
strncpy(_aPathName, __stringVal(aPathName), MAXPATHLEN-1); _aPathName[MAXPATHLEN-1] = '\0'; |
3741 | 3095 |
do { |
3822 | 3096 |
ret = __STX_C_CALL2( (void*)(chmod), (void *)_aPathName, (void *) __intVal(modeBits)); |
3741 | 3097 |
} while ((ret < 0) && (errno == EINTR)); |
3098 |
#else |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3099 |
__BEGIN_INTERRUPTABLE__ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3100 |
do { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3101 |
ret = chmod((char *)__stringVal(aPathName), __intVal(modeBits)); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3102 |
} while (ret < 0 && errno == EINTR); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3103 |
__END_INTERRUPTABLE__ |
3741 | 3104 |
#endif |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3105 |
if (ret < 0) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3106 |
@global(LastErrorNumber) = __MKSMALLINT(errno); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3107 |
RETURN ( false ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3108 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3109 |
RETURN ( true ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3110 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3111 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3112 |
^ self primitiveFailed |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3113 |
! ! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3114 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3115 |
!Win32OperatingSystem class methodsFor:'file queries'! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3116 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3117 |
caseSensitiveFilenames |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3118 |
"return true, if the OS has caseSensitive file naming. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3119 |
On MSDOS, this will return false; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3120 |
on a real OS, we return true." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3121 |
|
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
3122 |
^ false |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3123 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3124 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3125 |
compressPath:pathName |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3126 |
"return the pathName compressed - that is, remove all ..-entries |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3127 |
and . entries. This does not always (in case of symbolic links) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3128 |
return the true pathName and is therefore used as a fallback |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3129 |
if realPath and popen failed." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3130 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3131 |
|names n "{ Class: SmallInteger }" | |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3132 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3133 |
names := pathName |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3134 |
asCollectionOfSubstringsSeparatedBy:self fileSeparator. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3135 |
names := names asOrderedCollection. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3136 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3137 |
cut off initial double-slashes |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3138 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3139 |
[names startsWith:#('' '')] whileTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3140 |
names removeFirst. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3141 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3142 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3143 |
cut off double-slashes at end |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3144 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3145 |
[names endsWith:#('')] whileTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3146 |
names removeLast. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3147 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3148 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3149 |
cut off current-dir at beginning |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3150 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3151 |
n := names size. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3152 |
[(n >= 2) and:[names startsWith:#('.')]] whileTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3153 |
names removeFirst. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3154 |
n := n - 1. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3155 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3156 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3157 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3158 |
cut off parent-dirs at end |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3159 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3160 |
[(n > 2) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3161 |
and:[(names endsWith:#('..')) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3162 |
and:[((names at:(n - 1)) startsWith:'.') not ]]] whileTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3163 |
names removeLast; removeLast. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3164 |
n := n - 2. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3165 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3166 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3167 |
^ names asStringWith:self fileSeparator |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3168 |
from:1 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3169 |
to:n |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3170 |
compressTabs:false final:nil |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3171 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3172 |
" |
3796 | 3173 |
OperatingSystem compressPath:'./..' |
3174 |
OperatingSystem compressPath:'/foo/bar/baz/..' |
|
3175 |
OperatingSystem compressPath:'foo/bar/baz/..' |
|
3176 |
OperatingSystem compressPath:'foo/bar/baz/../' |
|
3177 |
OperatingSystem compressPath:'foo/bar/baz/..///' |
|
3178 |
OperatingSystem compressPath:'///foo/bar/baz/..///' |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3179 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3180 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3181 |
"Modified: 1.11.1996 / 20:13:48 / cg" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3182 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3183 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3184 |
fileSeparator |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3185 |
"return the character used to separate names in a path. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3186 |
This character differs for MSDOS and other systems, |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3187 |
(but those are currently not supported - so this is some |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3188 |
preparation for the future)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3189 |
|
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
3190 |
^ $\ |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3191 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3192 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3193 |
getDriveList |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3194 |
"return a list of volumes in the system. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3195 |
On unix, no such thing like a volume exists |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3196 |
- there, a syntetic list with root, home & current is returned. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3197 |
On MSDOS, a list of drive letters is (eventually) returned. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3198 |
On VMS, a list of volumes is (eventually) returned." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3199 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3200 |
|list| |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3201 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3202 |
list := OrderedCollection new. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3203 |
%{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3204 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3205 |
* add drive letters as strings to list ... |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3206 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3207 |
char buffer[1024]; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3208 |
char *cp; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3209 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3210 |
GetLogicalDriveStrings(1023, buffer); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3211 |
for (cp=buffer; *cp; ) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3212 |
__SSEND1(list, @symbol(add:), 0, __MKSTRING(cp)); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3213 |
cp += strlen(cp) + 1; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3214 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3215 |
%}. |
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
3216 |
^ list |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3217 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3218 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3219 |
infoOf:aPathName |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3220 |
"return some object filled with info for the file 'aPathName'; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3221 |
the info (for which corresponding access methods are understood by |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3222 |
the returned object) is: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3223 |
type - a symbol giving the files type |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3224 |
mode - numeric access mode |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3225 |
uid - owners user id |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3226 |
gid - owners group id |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3227 |
size - files size |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3228 |
id - files number (i.e. inode number) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3229 |
accessed - last access time (as Timestamp) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3230 |
modified - last modification time (as Timestamp) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3231 |
statusChanged - last status change time (as Timestamp) |
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
3232 |
alternativeName - (windows only:) the MSDOS name of the file |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3233 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3234 |
Some of the fields may be returned as nil on systems which do not provide |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3235 |
all of the information. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3236 |
Return nil if such a file does not exist. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3237 |
For symbolic links (if supported by the OS), |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3238 |
the info of the pointed-to-file (i.e. the target) is returned; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3239 |
use #linkInfoOf: to get info about the link itself. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3240 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3241 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3242 |
|info type mode uid gid size id |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3243 |
atime mtime ctime |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3244 |
aOStime mOStime cOStime |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3245 |
aYr aMon aDay aHr aMin aSec aMS |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3246 |
mYr mMon mDay mHr mMin mSec mMS |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3247 |
cYr cMon cDay cHr cMin cSec cMS |
3563 | 3248 |
name2| |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3249 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3250 |
%{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3251 |
struct stat buf; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3252 |
int ret; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3253 |
char nameBuffer[15]; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3254 |
unsigned INT ino; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3255 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3256 |
if (__isString(aPathName)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3257 |
HANDLE hFile; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3258 |
SYSTEMTIME creationTime; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3259 |
SYSTEMTIME accessTime; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3260 |
SYSTEMTIME modificationTime; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3261 |
int modeBits = 0; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3262 |
WIN32_FIND_DATA findStruct; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3263 |
|
3838
21d4f8ea3c28
use wrapCall for FindFirstFile (in #infoOf:)
Claus Gittinger <cg@exept.de>
parents:
3837
diff
changeset
|
3264 |
#ifdef DO_WRAP_CALLS |
21d4f8ea3c28
use wrapCall for FindFirstFile (in #infoOf:)
Claus Gittinger <cg@exept.de>
parents:
3837
diff
changeset
|
3265 |
{ |
21d4f8ea3c28
use wrapCall for FindFirstFile (in #infoOf:)
Claus Gittinger <cg@exept.de>
parents:
3837
diff
changeset
|
3266 |
char _aPathName[MAXPATHLEN]; |
21d4f8ea3c28
use wrapCall for FindFirstFile (in #infoOf:)
Claus Gittinger <cg@exept.de>
parents:
3837
diff
changeset
|
3267 |
|
21d4f8ea3c28
use wrapCall for FindFirstFile (in #infoOf:)
Claus Gittinger <cg@exept.de>
parents:
3837
diff
changeset
|
3268 |
strncpy(_aPathName, __stringVal(aPathName), MAXPATHLEN-1); _aPathName[MAXPATHLEN-1] = '\0'; |
21d4f8ea3c28
use wrapCall for FindFirstFile (in #infoOf:)
Claus Gittinger <cg@exept.de>
parents:
3837
diff
changeset
|
3269 |
hFile = __STX_API_CALL2( (void*)FindFirstFile, (void *)_aPathName, &findStruct); |
21d4f8ea3c28
use wrapCall for FindFirstFile (in #infoOf:)
Claus Gittinger <cg@exept.de>
parents:
3837
diff
changeset
|
3270 |
} |
21d4f8ea3c28
use wrapCall for FindFirstFile (in #infoOf:)
Claus Gittinger <cg@exept.de>
parents:
3837
diff
changeset
|
3271 |
#else |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3272 |
hFile = FindFirstFile(__stringVal(aPathName), &findStruct); |
3838
21d4f8ea3c28
use wrapCall for FindFirstFile (in #infoOf:)
Claus Gittinger <cg@exept.de>
parents:
3837
diff
changeset
|
3273 |
#endif |
3842 | 3274 |
if (! hFile || (hFile == (HANDLE)(-1)) || (hFile == INVALID_HANDLE_VALUE)) { |
3861
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
3275 |
@global(LastErrorNumber) = __MKSMALLINT(__WIN32_ERR(GetLastError())); |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3276 |
RETURN (nil); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3277 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3278 |
FindClose(hFile); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3279 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3280 |
id = __MKSMALLINT(0); /* could get it by opening ... */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3281 |
size = __MKLARGEINT64(1, findStruct.nFileSizeLow, findStruct.nFileSizeHigh); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3282 |
|
3756
62adcff758af
empty short-name is no shortName
Claus Gittinger <cg@exept.de>
parents:
3747
diff
changeset
|
3283 |
if (findStruct.cAlternateFileName[0] != '\0') { |
62adcff758af
empty short-name is no shortName
Claus Gittinger <cg@exept.de>
parents:
3747
diff
changeset
|
3284 |
bcopy(findStruct.cAlternateFileName, nameBuffer, 14); |
62adcff758af
empty short-name is no shortName
Claus Gittinger <cg@exept.de>
parents:
3747
diff
changeset
|
3285 |
nameBuffer[14] = '\0'; |
62adcff758af
empty short-name is no shortName
Claus Gittinger <cg@exept.de>
parents:
3747
diff
changeset
|
3286 |
name2 = __MKSTRING(nameBuffer); /* DOS name */ |
62adcff758af
empty short-name is no shortName
Claus Gittinger <cg@exept.de>
parents:
3747
diff
changeset
|
3287 |
} |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3288 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3289 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3290 |
* simulate access bits |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3291 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3292 |
if (findStruct.dwFileAttributes & FILE_ATTRIBUTE_READONLY) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3293 |
modeBits = 0444; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3294 |
} else { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3295 |
modeBits = 0666; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3296 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3297 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3298 |
if (findStruct.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3299 |
type = @symbol(directory); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3300 |
modeBits |= 0111; /* executable */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3301 |
} else { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3302 |
type = @symbol(regular); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3303 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3304 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3305 |
mode = __MKSMALLINT(modeBits); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3306 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3307 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3308 |
* sigh - convert from stupid time to useful time |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3309 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3310 |
FileTimeToSystemTime(&(findStruct.ftCreationTime), &creationTime); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3311 |
FileTimeToSystemTime(&(findStruct.ftLastAccessTime), &accessTime); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3312 |
FileTimeToSystemTime(&(findStruct.ftLastWriteTime), &modificationTime); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3313 |
aYr = __MKSMALLINT(accessTime.wYear); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3314 |
aMon = __MKSMALLINT(accessTime.wMonth); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3315 |
aDay = __MKSMALLINT(accessTime.wDay); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3316 |
aHr = __MKSMALLINT(accessTime.wHour); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3317 |
aMin = __MKSMALLINT(accessTime.wMinute); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3318 |
aSec = __MKSMALLINT(accessTime.wSecond); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3319 |
aMS = __MKSMALLINT(accessTime.wMilliseconds); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3320 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3321 |
mYr = __MKSMALLINT(modificationTime.wYear); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3322 |
mMon = __MKSMALLINT(modificationTime.wMonth); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3323 |
mDay = __MKSMALLINT(modificationTime.wDay); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3324 |
mHr = __MKSMALLINT(modificationTime.wHour); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3325 |
mMin = __MKSMALLINT(modificationTime.wMinute); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3326 |
mSec = __MKSMALLINT(modificationTime.wSecond); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3327 |
mMS = __MKSMALLINT(modificationTime.wMilliseconds); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3328 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3329 |
cYr = __MKSMALLINT(creationTime.wYear); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3330 |
cMon = __MKSMALLINT(creationTime.wMonth); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3331 |
cDay = __MKSMALLINT(creationTime.wDay); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3332 |
cHr = __MKSMALLINT(creationTime.wHour); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3333 |
cMin = __MKSMALLINT(creationTime.wMinute); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3334 |
cSec = __MKSMALLINT(creationTime.wSecond); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3335 |
cMS = __MKSMALLINT(creationTime.wMilliseconds); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3336 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3337 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3338 |
mode notNil ifTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3339 |
aOStime notNil ifTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3340 |
atime := AbsoluteTime fromOSTime:(aOStime * 1000). |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3341 |
mtime := AbsoluteTime fromOSTime:(mOStime * 1000). |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3342 |
ctime := AbsoluteTime fromOSTime:(cOStime * 1000). |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3343 |
] ifFalse:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3344 |
atime := AbsoluteTime day:aDay month:aMon year:aYr hour:aHr minutes:aMin seconds:aSec milliseconds:aMS. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3345 |
mtime := AbsoluteTime day:mDay month:mMon year:mYr hour:mHr minutes:mMin seconds:mSec milliseconds:mMS. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3346 |
ctime := AbsoluteTime day:cDay month:cMon year:cYr hour:cHr minutes:cMin seconds:cSec milliseconds:cMS. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3347 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3348 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3349 |
info := FileStatusInfo |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3350 |
type:type |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3351 |
mode:mode |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3352 |
uid:uid |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3353 |
gid:gid |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3354 |
size:size |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3355 |
id:id |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3356 |
accessed:atime |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3357 |
modified:mtime |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3358 |
statusChanged:ctime |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3359 |
path:nil |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3360 |
alternativeName:name2. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3361 |
^ info |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3362 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3363 |
^ self primitiveFailed |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3364 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3365 |
" |
3796 | 3366 |
OperatingSystem infoOf:'/' |
3367 |
(OperatingSystem infoOf:'/') uid |
|
3368 |
(OperatingSystem infoOf:'/') accessed |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3369 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3370 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3371 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3372 |
isDirectory:aPathName |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3373 |
"return true, if 'aPathName' is a valid directory path name. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3374 |
(i.e. exists and is a directory). |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3375 |
This also returns true for symbolic links pointing to a directory; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3376 |
if you need to check for this, use #linkInfo:." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3377 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3378 |
%{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3379 |
int ret; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3380 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3381 |
if (__isString(aPathName)) { |
3817
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3382 |
#ifdef DO_WRAP_CALLS |
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3383 |
char _aPathName[MAXPATHLEN]; |
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3384 |
|
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3385 |
strncpy(_aPathName, __stringVal(aPathName), MAXPATHLEN-1); _aPathName[MAXPATHLEN-1] = '\0'; |
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3386 |
do { |
3822 | 3387 |
ret = __STX_API_CALL1( (void*)GetFileAttributes, (void *)_aPathName); |
3817
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3388 |
} while ((ret < 0) && (errno == EINTR)); |
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3389 |
#else |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3390 |
ret = GetFileAttributes((char *) __stringVal(aPathName)); |
3817
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3391 |
#endif |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3392 |
if (ret == -1) { |
3861
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
3393 |
@global(LastErrorNumber) = __MKSMALLINT(__WIN32_ERR(GetLastError())); |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3394 |
RETURN ( false ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3395 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3396 |
RETURN ( (ret & FILE_ATTRIBUTE_DIRECTORY) ? true : false); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3397 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3398 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3399 |
^ self primitiveFailed |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3400 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3401 |
"an alternative implementation would be: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3402 |
^ (self infoOf:aPathName) type == #directory |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3403 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3404 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3405 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3406 |
isExecutable:aPathName |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3407 |
"return true, if the given file is executable. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3408 |
For symbolic links, the pointed-to-file is checked." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3409 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3410 |
%{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3411 |
int ret; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3412 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3413 |
if (__isString(aPathName)) { |
3817
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3414 |
#ifdef DO_WRAP_CALLS |
3779
6409bc73ce3c
copy all strings to a buffer when doing wrap-calls
Claus Gittinger <cg@exept.de>
parents:
3772
diff
changeset
|
3415 |
int access(); |
6409bc73ce3c
copy all strings to a buffer when doing wrap-calls
Claus Gittinger <cg@exept.de>
parents:
3772
diff
changeset
|
3416 |
char _aPathName[MAXPATHLEN]; |
6409bc73ce3c
copy all strings to a buffer when doing wrap-calls
Claus Gittinger <cg@exept.de>
parents:
3772
diff
changeset
|
3417 |
|
6409bc73ce3c
copy all strings to a buffer when doing wrap-calls
Claus Gittinger <cg@exept.de>
parents:
3772
diff
changeset
|
3418 |
strncpy(_aPathName, __stringVal(aPathName), MAXPATHLEN-1); _aPathName[MAXPATHLEN-1] = '\0'; |
6409bc73ce3c
copy all strings to a buffer when doing wrap-calls
Claus Gittinger <cg@exept.de>
parents:
3772
diff
changeset
|
3419 |
do { |
3822 | 3420 |
ret = __STX_C_CALL2( (void*)access, (void *)_aPathName, (void *) X_OK); |
3741 | 3421 |
} while ((ret < 0) && (errno == EINTR)); |
3422 |
#else |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3423 |
__BEGIN_INTERRUPTABLE__ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3424 |
do { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3425 |
ret = access(__stringVal(aPathName), X_OK); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3426 |
} while ((ret < 0) && (errno == EINTR)); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3427 |
__END_INTERRUPTABLE__ |
3741 | 3428 |
#endif |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3429 |
if (ret < 0) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3430 |
@global(LastErrorNumber) = __MKSMALLINT(errno); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3431 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3432 |
RETURN ( ((ret == 0) ? true : false) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3433 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3434 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3435 |
^ self primitiveFailed |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3436 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3437 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3438 |
isReadable:aPathName |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3439 |
"return true, if the file/dir 'aPathName' is readable. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3440 |
For symbolic links, the pointed-to-file is checked." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3441 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3442 |
%{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3443 |
int ret; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3444 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3445 |
if (__isString(aPathName)) { |
3817
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3446 |
#ifdef DO_WRAP_CALLS |
3779
6409bc73ce3c
copy all strings to a buffer when doing wrap-calls
Claus Gittinger <cg@exept.de>
parents:
3772
diff
changeset
|
3447 |
int access(); |
6409bc73ce3c
copy all strings to a buffer when doing wrap-calls
Claus Gittinger <cg@exept.de>
parents:
3772
diff
changeset
|
3448 |
char _aPathName[MAXPATHLEN]; |
6409bc73ce3c
copy all strings to a buffer when doing wrap-calls
Claus Gittinger <cg@exept.de>
parents:
3772
diff
changeset
|
3449 |
|
6409bc73ce3c
copy all strings to a buffer when doing wrap-calls
Claus Gittinger <cg@exept.de>
parents:
3772
diff
changeset
|
3450 |
strncpy(_aPathName, __stringVal(aPathName), MAXPATHLEN-1); _aPathName[MAXPATHLEN-1] = '\0'; |
6409bc73ce3c
copy all strings to a buffer when doing wrap-calls
Claus Gittinger <cg@exept.de>
parents:
3772
diff
changeset
|
3451 |
do { |
3822 | 3452 |
ret = __STX_C_CALL2( (void*)access, (void *)_aPathName, (void *) R_OK); |
3741 | 3453 |
} while ((ret < 0) && (errno == EINTR)); |
3454 |
#else |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3455 |
__BEGIN_INTERRUPTABLE__ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3456 |
do { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3457 |
ret = access(__stringVal(aPathName), R_OK); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3458 |
} while ((ret < 0) && (errno == EINTR)); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3459 |
__END_INTERRUPTABLE__ |
3741 | 3460 |
#endif |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3461 |
if (ret < 0) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3462 |
@global(LastErrorNumber) = __MKSMALLINT(errno); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3463 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3464 |
RETURN ( ((ret == 0) ? true : false) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3465 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3466 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3467 |
^ self primitiveFailed |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3468 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3469 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3470 |
isSymbolicLink:aPathName |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3471 |
"return true, if the given file is a symbolic link" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3472 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3473 |
^ (self linkInfoOf:aPathName) notNil |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3474 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3475 |
" |
3796 | 3476 |
OperatingSystem isSymbolicLink:'Make.proto' |
3477 |
OperatingSystem isSymbolicLink:'Makefile' |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3478 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3479 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3480 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3481 |
isValidPath:aPathName |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3482 |
"return true, if 'aPathName' is a valid path name |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3483 |
(i.e. the file or directory exists)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3484 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3485 |
%{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3486 |
struct stat buf; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3487 |
int ret; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3488 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3489 |
if (__isString(aPathName) || __isSymbol(aPathName) ) { |
3817
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3490 |
#ifdef DO_WRAP_CALLS |
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3491 |
char _aPathName[MAXPATHLEN]; |
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3492 |
|
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3493 |
strncpy(_aPathName, __stringVal(aPathName), MAXPATHLEN-1); _aPathName[MAXPATHLEN-1] = '\0'; |
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3494 |
do { |
3822 | 3495 |
ret = __STX_API_CALL1( (void*)GetFileAttributes, (void *)_aPathName); |
3817
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3496 |
} while ((ret < 0) && (errno == EINTR)); |
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3497 |
#else |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3498 |
ret = GetFileAttributes((char *) __stringVal(aPathName)); |
3817
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3499 |
#endif |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3500 |
if (ret == -1) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3501 |
RETURN ( false ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3502 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3503 |
RETURN (true); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3504 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3505 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3506 |
^ self primitiveFailed |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3507 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3508 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3509 |
isWritable:aPathName |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3510 |
"return true, if the given file is writable. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3511 |
For symbolic links, the pointed-to-file is checked." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3512 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3513 |
%{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3514 |
int ret; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3515 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3516 |
if (__isString(aPathName)) { |
3817
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3517 |
#ifdef DO_WRAP_CALLS |
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3518 |
char _aPathName[MAXPATHLEN]; |
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3519 |
|
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3520 |
strncpy(_aPathName, __stringVal(aPathName), MAXPATHLEN-1); _aPathName[MAXPATHLEN-1] = '\0'; |
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3521 |
do { |
3822 | 3522 |
ret = __STX_API_CALL1( (void*)GetFileAttributes, (void *)_aPathName); |
3817
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3523 |
} while ((ret < 0) && (errno == EINTR)); |
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3524 |
#else |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3525 |
ret = GetFileAttributes((char *) __stringVal(aPathName)); |
3817
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3526 |
#endif |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3527 |
if (ret == -1) { |
3861
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
3528 |
@global(LastErrorNumber) = __MKSMALLINT(__WIN32_ERR(GetLastError())); |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3529 |
RETURN ( false ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3530 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3531 |
RETURN ( (ret & FILE_ATTRIBUTE_READONLY) ? false : true); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3532 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3533 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3534 |
^ self primitiveFailed |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3535 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3536 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3537 |
linkInfoOf:aPathName |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3538 |
"return a dictionary filled with info for the file 'aPathName', |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3539 |
IFF aPathName is a symbolic link. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3540 |
If aPathName is invalid, or its NOT a symbolic link, nil is returned. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3541 |
(which means, that systems like VMS or MSDOS always return nil here.) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3542 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3543 |
The contents of the dictionary gives info about the link itself, |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3544 |
on contrast to #infoOf:, which returns the info of the pointed to file |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3545 |
in case of a symbolic link." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3546 |
|
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
3547 |
^ nil |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3548 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3549 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3550 |
parentDirectoryName |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3551 |
"return the name used to refer to parent directories. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3552 |
In MSDOS, Unix and other systems this is '..', but maybe different |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3553 |
for other systems. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3554 |
(but those are currently not supported - so this is some |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3555 |
preparation for the future)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3556 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3557 |
^ '..' |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3558 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3559 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3560 |
pathNameOf:pathName |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3561 |
"return the pathName of the argument, aPathString, |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3562 |
- thats the full pathname of the directory, starting at '/'. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3563 |
This method needs the path to be valid |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3564 |
(i.e. all directories must exist, be readable and executable). |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3565 |
Notice: if symbolic links are involved, the result may look different |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3566 |
from what you expect." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3567 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3568 |
|p path command| |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3569 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3570 |
"some systems have a convenient function for this ..." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3571 |
path := self primPathNameOf:pathName. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3572 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3573 |
path isNil ifTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3574 |
(self isValidPath:pathName) ifFalse:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3575 |
p := pathName. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3576 |
[(p size > 1) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3577 |
and:[p endsWith:(self fileSeparator)] |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3578 |
] whileTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3579 |
p := p copyWithoutLast:1. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3580 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3581 |
^ p |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3582 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3583 |
|
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
3584 |
"/ |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
3585 |
"/ return the original - there is nothing else can we do |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
3586 |
"/ |
3572 | 3587 |
path := self compressPath:pathName |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3588 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3589 |
^ path. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3590 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3591 |
" |
3796 | 3592 |
OperatingSystem pathNameOf:'.' |
3593 |
OperatingSystem pathNameOf:'../smalltalk/../smalltalk' |
|
3594 |
OperatingSystem pathNameOf:'../../..' |
|
3595 |
OperatingSystem pathNameOf:'..' |
|
3596 |
OperatingSystem pathNameOf:'/tmp////' |
|
3597 |
OperatingSystem pathNameOf:'/foo/bar' |
|
3598 |
OperatingSystem pathNameOf:'/foo/bar/' |
|
3599 |
OperatingSystem pathNameOf:'/foo/bar//' |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3600 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3601 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3602 |
"Modified: 29.11.1996 / 18:02:12 / stefan" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3603 |
"Modified: 10.1.1997 / 19:10:42 / cg" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3604 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3605 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3606 |
primIdOf:aPathName |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3607 |
"the actual code to return the fileNumber (i.e. inode number) of a file." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3608 |
|
3741 | 3609 |
^ nil |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3610 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3611 |
|
3817
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3612 |
primPathNameOf:aPathName |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3613 |
"return the pathName of the argument, aPathString, |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3614 |
- thats the full pathname of the directory, starting at '/'. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3615 |
This method here returns nil, if the OS does not provide a |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3616 |
realPath library function. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3617 |
Notice: if symbolic links are involved, the result may look different |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3618 |
from what you expect." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3619 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3620 |
|path| |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3621 |
|
3741 | 3622 |
%{ /* xxSTACK: 16000 */ |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3623 |
|
3817
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3624 |
if (__isString(aPathName)) { |
3810 | 3625 |
char nameBuffer[MAXPATHLEN + 1 + MAXPATHLEN + 1]; |
3626 |
char *pFinal; |
|
3817
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3627 |
int rslt; |
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3628 |
|
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3629 |
#ifdef DO_WRAP_CALLS |
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3630 |
char _aPathName[MAXPATHLEN]; |
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3631 |
|
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3632 |
strncpy(_aPathName, __stringVal(aPathName), MAXPATHLEN-1); _aPathName[MAXPATHLEN-1] = '\0'; |
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3633 |
do { |
3822 | 3634 |
rslt = __STX_API_CALL4( (void*)GetFullPathName, (void *)_aPathName, sizeof(nameBuffer), nameBuffer, &pFinal); |
3817
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3635 |
} while ((rslt < 0) && (errno == EINTR)); |
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3636 |
#else |
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3637 |
rslt = GetFullPathName(__stringVal(aPathName), sizeof(nameBuffer), nameBuffer, &pFinal); |
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3638 |
#endif |
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
3639 |
if (rslt) { |
3810 | 3640 |
RETURN ( __MKSTRING(nameBuffer) ); |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3641 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3642 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3643 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3644 |
^ nil |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3645 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3646 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3647 |
timeOfLastAccess:aPathName |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3648 |
"return the time, when the file was last accessed. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3649 |
For nonexistent files, nil is returned." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3650 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3651 |
"could be implemented as: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3652 |
(self infoOf:aPathName) accessed |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3653 |
" |
3741 | 3654 |
| i| |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3655 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3656 |
i := self infoOf:aPathName. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3657 |
i notNil ifTrue:[^ i accessed]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3658 |
^ nil. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3659 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3660 |
" |
3796 | 3661 |
OperatingSystem timeOfLastAccess:'/' |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3662 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3663 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3664 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3665 |
timeOfLastChange:aPathName |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3666 |
"return the time, when the file was last changed. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3667 |
For nonexistent files, nil is returned." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3668 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3669 |
"could be implemented as: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3670 |
(self infoOf:aPathName) modified |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3671 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3672 |
|
3741 | 3673 |
| i| |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3674 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3675 |
i := self infoOf:aPathName. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3676 |
i notNil ifTrue:[^ i modified]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3677 |
^ nil. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3678 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3679 |
" |
3796 | 3680 |
OperatingSystem timeOfLastChange:'/' |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3681 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3682 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3683 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3684 |
typeOf:aPathName |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3685 |
"return the type of a file as a symbol; for nonexistent files, |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3686 |
nil is returned. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3687 |
Notice: for symbolic links, the type of the pointed-to file is returned." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3688 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3689 |
|i| |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3690 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3691 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3692 |
this could have been implemented as: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3693 |
(self infoOf:aPathName) type |
3741 | 3694 |
" |
3695 |
||
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3696 |
i := self infoOf:aPathName. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3697 |
i notNil ifTrue:[^ i type]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3698 |
^ nil. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3699 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3700 |
" |
3796 | 3701 |
OperatingSystem typeOf:'/' |
3702 |
OperatingSystem typeOf:'.' |
|
3703 |
OperatingSystem typeOf:'Make.proto' |
|
3704 |
OperatingSystem typeOf:'resources/motif.style' |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3705 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3706 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3707 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3708 |
volumeNameOf:aPathString |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3709 |
"return the volumeName of the argument, aPath |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3710 |
- thats the name of the volume where aPath is. |
3796 | 3711 |
Not all OperatingSystem support/use volumes; on unix, |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3712 |
this always returns an empty string." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3713 |
|
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
3714 |
(aPathString at:2) == $: ifTrue:[ |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
3715 |
^ (aPathString at:1) asString. |
3563 | 3716 |
]. |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3717 |
^ '' |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3718 |
! ! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3719 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3720 |
!Win32OperatingSystem class methodsFor:'interrupts & signals'! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3721 |
|
3819 | 3722 |
blockingTest |
3723 |
"this is a test method; |
|
3724 |
For testing double CTRL-C in blocking primitives" |
|
3725 |
||
3726 |
%{ |
|
3727 |
while(1) |
|
3728 |
{ |
|
3729 |
printf("b"); |
|
3730 |
Sleep(50); |
|
3731 |
} |
|
3732 |
%}. |
|
3733 |
" |
|
3734 |
OperatingSystem blockingTest |
|
3735 |
" |
|
3736 |
! |
|
3737 |
||
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3738 |
defaultSignal:signalNumber |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3739 |
"revert to the default action on arrival of a (Unix-)signal. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3740 |
Dont confuse Unix signals with smalltalk signals. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3741 |
WARNING: for some signals, it is no good idea to revert to default; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3742 |
for example, the default for SIGINT (i.e. ^C) is to exit; while the |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3743 |
default for SIGQUIT (^ \) is to dump core. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3744 |
Also, NOTICE that signal numbers are not portable between unix |
3796 | 3745 |
systems - use OperatingSystem sigXXX to get the numeric value for |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3746 |
a signal." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3747 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3748 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3749 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3750 |
if (__isSmallInteger(signalNumber)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3751 |
#ifdef SIG_DFL |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3752 |
signal(__intVal(signalNumber), SIG_DFL); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3753 |
RETURN (self); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3754 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3755 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3756 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3757 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3758 |
this error is triggered on non-integer argument |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3759 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3760 |
^ self primitiveFailed |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3761 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3762 |
"you better save a snapshot image before trying this ..." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3763 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3764 |
'if you hit ^C now, Smalltalk will exit immediately' printNewline. |
3796 | 3765 |
OperatingSystem defaultSignal:(OperatingSystem sigINT). |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3766 |
1 to:1000000 do:[:i| ]. |
3796 | 3767 |
OperatingSystem enableSignal:(OperatingSystem sigINT). |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3768 |
'normal ^C handling again.' printNewline |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3769 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3770 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3771 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3772 |
disableIOInterruptsOn:fd |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3773 |
"turn off IO interrupts for a filedescriptor" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3774 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3775 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3776 |
this error is triggered on non-integer argument |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3777 |
or if the OS does not support IO interrupts. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3778 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3779 |
^ self primitiveFailed |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3780 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3781 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3782 |
disableSignal:signalNumber |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3783 |
"disable (Unix-) signal processing for signalNumber. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3784 |
Dont confuse Unix signals with smalltalk signals. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3785 |
WARNING: for some signals, it is no good idea to disable |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3786 |
them; for example, disabling the SIGINT signal turns off ^C |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3787 |
handling. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3788 |
Also, NOTICE that signal numbers are not portable between unix |
3796 | 3789 |
systems - use OperatingSystem sigXXX to get the numeric value for |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3790 |
a signal. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3791 |
Use only for fully debugged stand alone applications." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3792 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3793 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3794 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3795 |
if (__isSmallInteger(signalNumber)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3796 |
int sigNo = __intVal(signalNumber); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3797 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3798 |
if (sigNo == 0) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3799 |
RETURN (self); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3800 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3801 |
#ifdef SIG_IGN |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3802 |
signal(sigNo, SIG_IGN); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3803 |
RETURN (self); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3804 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3805 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3806 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3807 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3808 |
this error is triggered on non-integer argument |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3809 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3810 |
^ self primitiveFailed |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3811 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3812 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3813 |
'now, ^C is totally ignored ...' printNewline. |
3796 | 3814 |
OperatingSystem disableSignal:(OperatingSystem sigINT). |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3815 |
1 to:1000000 do:[:i| ]. |
3796 | 3816 |
OperatingSystem enableSignal:(OperatingSystem sigINT). |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3817 |
'^C handled again.' printNewline |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3818 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3819 |
! |
3810 | 3820 |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3821 |
disableTimer |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3822 |
"disable timer interrupts. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3823 |
WARNING: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3824 |
the system will not operate correctly with timer interrupts |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3825 |
disabled, because no scheduling or timeouts are possible." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3826 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3827 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3828 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3829 |
extern void __win32ClearTimer(); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3830 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3831 |
__win32ClearTimer(); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3832 |
%}. |
3810 | 3833 |
^ true |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3834 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3835 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3836 |
enableChildSignalInterrupts |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3837 |
"enable childSignal interrupts |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3838 |
(SIGCHLD, if the architecture supports it). |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3839 |
After enabling, these signals will send the message |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3840 |
'childSignalInterrupt' to the ChildSignalInterruptHandler object." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3841 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3842 |
self enableSignal:(self sigCHLD) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3843 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3844 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3845 |
enableIOInterruptsOn:fd |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3846 |
"turn on IO interrupts for a filedescriptor" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3847 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3848 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3849 |
this error is triggered on non-integer argument |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3850 |
or if the system does not support SIGIO |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3851 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3852 |
^ self primitiveFailed |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3853 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3854 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3855 |
enableSignal:signalNumber |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3856 |
"enable (Unix-)signal processing for signalNumber. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3857 |
Dont confuse Unix signals with smalltalk signals. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3858 |
The signal will be delivered to one of the standard handlers |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3859 |
(SIGINT, SIGQUIT, etc) or to a general handler, which |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3860 |
sends #signalInterrupt:. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3861 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3862 |
NOTICE that signal numbers are not portable between unix |
3796 | 3863 |
systems - use OperatingSystem sigXXX to get the numeric value for |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3864 |
a signal." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3865 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3866 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3867 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3868 |
#ifdef NSIG |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3869 |
# define SIG_LIMIT NSIG |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3870 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3871 |
# ifdef SIGUSR2 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3872 |
# define SIG_LIMIT SIGUSR2 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3873 |
# else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3874 |
# ifdef SIGUSR |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3875 |
# define SIG_LIMIT SIGUSR |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3876 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3877 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3878 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3879 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3880 |
#if defined(SIGPOLL) && !defined(SIGIO) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3881 |
# define SIGIO SIGPOLL |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3882 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3883 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3884 |
#ifdef SIGCHLD |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3885 |
# define CHILD_SIGNAL SIGCHLD |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3886 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3887 |
# ifdef SIGCLD |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3888 |
# define CHILD_SIGNAL SIGCLD |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3889 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3890 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3891 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3892 |
int sigNr; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3893 |
#if defined(SIGINT) || defined(SIGQUIT) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3894 |
# ifndef __signalUserInterrupt |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3895 |
extern void __signalUserInterrupt(SIGHANDLER_ARG); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3896 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3897 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3898 |
#ifdef SIGFPE |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3899 |
# ifndef __signalFpExceptionInterrupt |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3900 |
extern void __signalFpExceptionInterrupt(SIGHANDLER_ARG); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3901 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3902 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3903 |
#ifdef SIGIO |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3904 |
# ifndef __signalIoInterrupt |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3905 |
extern void __signalIoInterrupt(SIGHANDLER_ARG); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3906 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3907 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3908 |
#ifdef CHILD_SIGNAL |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3909 |
# ifndef __signalChildInterrupt |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3910 |
extern void __signalChildInterrupt(SIGHANDLER_ARG); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3911 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3912 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3913 |
#ifdef SIGPIPE |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3914 |
# ifndef __signalPIPEInterrupt |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3915 |
extern void __signalPIPEInterrupt(SIGHANDLER_ARG); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3916 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3917 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3918 |
#ifdef SIGBUS |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3919 |
# ifndef __signalBUSInterrupt |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3920 |
extern void __signalBUSInterrupt(SIGHANDLER_ARG); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3921 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3922 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3923 |
#ifdef SIGSEGV |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3924 |
# ifndef __signalSEGVInterrupt |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3925 |
extern void __signalSEGVInterrupt(SIGHANDLER_ARG); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3926 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3927 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3928 |
#if defined(SIGILL) || defined(SIGEMT) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3929 |
# ifndef __signalTrapInterrupt |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3930 |
extern void __signalTrapInterrupt(SIGHANDLER_ARG); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3931 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3932 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3933 |
#ifdef SIGALRM |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3934 |
# ifndef WIN32 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3935 |
# ifndef __signalTimerInterrupt |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3936 |
extern void __signalTimerInterrupt(SIGHANDLER_ARG); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3937 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3938 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3939 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3940 |
#ifndef __signalInterrupt |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3941 |
extern void __signalInterrupt(SIGHANDLER_ARG); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3942 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3943 |
void (*handler)(SIGHANDLER_ARG); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3944 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3945 |
if (__isSmallInteger(signalNumber) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3946 |
&& ((sigNr = __intVal(signalNumber)) >= 0) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3947 |
#ifdef SIG_LIMIT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3948 |
&& (sigNr <= SIG_LIMIT) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3949 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3950 |
) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3951 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3952 |
* standard signals are forced into standard handlers |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3953 |
* - all others go into general signalInterrupt |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3954 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3955 |
#if defined(SIGPOLL) && defined(SIGIO) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3956 |
if (sigNr == SIGPOLL) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3957 |
sigNr = SIGIO; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3958 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3959 |
switch (sigNr) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3960 |
case 0: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3961 |
/* enabling a non-supported signal */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3962 |
RETURN (self); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3963 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3964 |
#ifdef SIGBREAK |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3965 |
case SIGBREAK: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3966 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3967 |
#ifdef SIGINT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3968 |
case SIGINT: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3969 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3970 |
#ifdef SIGQUIT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3971 |
case SIGQUIT: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3972 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3973 |
#ifdef PROCESSDEBUGWIN32 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3974 |
printf("ConsoleSignal %d\n",sigNr); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3975 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3976 |
SetConsoleCtrlHandler((PHANDLER_ROUTINE)__signalUserInterruptWIN32,TRUE); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3977 |
RETURN (self); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3978 |
#ifdef SIGFPE |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3979 |
case SIGFPE: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3980 |
handler = __signalFpExceptionInterrupt; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3981 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3982 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3983 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3984 |
#ifdef SIGPIPE |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3985 |
case SIGPIPE: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3986 |
handler = __signalPIPEInterrupt; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3987 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3988 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3989 |
#ifdef SIGBUS |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3990 |
case SIGBUS: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3991 |
handler = __signalBUSInterrupt; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3992 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3993 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3994 |
#ifdef SIGSEGV |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3995 |
case SIGSEGV: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3996 |
handler = __signalSEGVInterrupt; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3997 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3998 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
3999 |
#ifdef SIGILL |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4000 |
case SIGILL: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4001 |
handler = __signalTrapInterrupt; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4002 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4003 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4004 |
#ifdef SIGEMT |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4005 |
case SIGEMT: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4006 |
handler = __signalTrapInterrupt; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4007 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4008 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4009 |
#ifdef SIGIO |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4010 |
case SIGIO: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4011 |
handler = __signalIoInterrupt; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4012 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4013 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4014 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4015 |
#ifdef CHILD_SIGNAL |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4016 |
case CHILD_SIGNAL: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4017 |
handler = __signalChildInterrupt; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4018 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4019 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4020 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4021 |
default: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4022 |
handler = __signalInterrupt; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4023 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4024 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4025 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4026 |
{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4027 |
#ifdef HAS_SIGACTION |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4028 |
struct sigaction act; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4029 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4030 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4031 |
* Do not add SA_RESTART here. A signal can cause a |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4032 |
* thread switch, another thread can do a garbage collect |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4033 |
* and restarted system calls may write into old |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4034 |
* (collected) addresses. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4035 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4036 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4037 |
act.sa_flags = SA_SIGINFO; /* <- if you add more, remember dummys at the top */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4038 |
sigemptyset(&act.sa_mask); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4039 |
act.sa_handler = handler; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4040 |
sigaction(sigNr, &act, 0); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4041 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4042 |
# ifdef HAS_SIGVEC |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4043 |
struct sigvec vec; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4044 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4045 |
vec.sv_flags = SV_INTERRUPT; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4046 |
sigemptyset(&vec.sv_mask); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4047 |
vec.sv_handler = handler; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4048 |
sigvec(sigNr, &vec, NULL); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4049 |
# else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4050 |
# ifdef WIN32 |
3810 | 4051 |
# ifdef PROCESSDEBUGWIN32 |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4052 |
printf("signal %d can't change handler\n",sigNr); |
3810 | 4053 |
# endif |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4054 |
# else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4055 |
(void) signal(sigNr, handler); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4056 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4057 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4058 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4059 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4060 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4061 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4062 |
* maybe, we should return the old enable-status |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4063 |
* as boolean here ... |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4064 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4065 |
RETURN (self); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4066 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4067 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4068 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4069 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4070 |
this error is triggered on non-integer argument, or |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4071 |
if the signal number is not in the valid range (1..NSIG) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4072 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4073 |
^ self primitiveFailed |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4074 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4075 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4076 |
enableTimer:milliSeconds |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4077 |
"setup for a timerInterrupt, to be signalled after some (real) time." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4078 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4079 |
%{ /* NOCONTEXT */ |
3810 | 4080 |
extern void __win32SetTimer(); |
4081 |
||
4082 |
if (__isSmallInteger(milliSeconds)) { |
|
4083 |
int millis; |
|
4084 |
millis = __intVal(milliSeconds); |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4085 |
__win32SetTimer(millis); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4086 |
RETURN (true); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4087 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4088 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4089 |
^ false |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4090 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4091 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4092 |
killProcess:processId |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4093 |
"kill a unix process. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4094 |
The process terminates immediately and has no chance to perform any cleanup actions. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4095 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4096 |
WARNING: in order to avoid zombie processes (on unix), |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4097 |
you have to fetch the processes exitstatus with |
3796 | 4098 |
OperatingSystem>>getStatusOfProcess:aProcessId." |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4099 |
|
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4100 |
self primTerminateProcess:processId |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4101 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4102 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4103 |
primTerminateProcess:pid |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4104 |
"terminate a WIN32 process. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4105 |
The TerminateProcess function is used to unconditionally cause |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4106 |
a process to exit. Use it only in extreme circumstances. The state of |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4107 |
global data maintained by dynamic-link libraries (DLLs) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4108 |
may be compromised if TerminateProcess is used." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4109 |
|
3741 | 4110 |
%{ /* xxLIMITEDSTACK (WIN95 only)*/ |
3810 | 4111 |
if (__isExternalAddress(pid) ) { |
3741 | 4112 |
#ifdef PROCESS1DEBUGWIN32 |
3810 | 4113 |
printf("Terminate ProcessHandle %x\n",_HANDLEVal(pid)); |
4114 |
#endif |
|
4115 |
if (_HANDLEVal(pid) != 0) { |
|
4116 |
TerminateProcess(_HANDLEVal(pid),-1); |
|
4117 |
CloseHandle(_HANDLEVal(pid)); |
|
4118 |
_HANDLEVal(pid) = 0; |
|
4119 |
} |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4120 |
} |
3741 | 4121 |
#ifdef PROCESS1DEBUGWIN32 |
4122 |
else |
|
4123 |
printf("Terminate wrong ProcessHandle\n"); |
|
4124 |
#endif |
|
4125 |
%} |
|
4126 |
! |
|
4127 |
||
4128 |
primTerminateProcessGroup:processGroupId |
|
4129 |
"terminate a WIN32 process. |
|
4130 |
The TerminateProcess function is used to unconditionally cause |
|
4131 |
a process to exit. Use it only in extreme circumstances. The state of |
|
4132 |
global data maintained by dynamic-link libraries (DLLs) |
|
4133 |
may be compromised if TerminateProcess is used." |
|
4134 |
||
4135 |
%{ /* xxLIMITEDSTACK (WIN95 only)*/ |
|
3810 | 4136 |
if (__isExternalAddress(processGroupId) ) { |
3741 | 4137 |
#ifdef PROCESS1DEBUGWIN32 |
3810 | 4138 |
printf("primTerminateProcessGroup ProcessHandle %x not yet implemented.\n",_HANDLEVal(processGroupId)); |
4139 |
#endif |
|
4140 |
if (_HANDLEVal(processGroupId) != 0) { |
|
4141 |
} |
|
3741 | 4142 |
} |
4143 |
#ifdef PROCESS1DEBUGWIN32 |
|
4144 |
else |
|
3810 | 4145 |
printf("primTerminateProcessGroup wrong ProcessGroupHandle\n"); |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4146 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4147 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4148 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4149 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4150 |
sendSignal:signalNumber to:processId |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4151 |
"send a unix signal to some process (maybe myself). |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4152 |
Returns false if any error occurred, true otherwise. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4153 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4154 |
Do not confuse UNIX signals with Smalltalk-Signals. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4155 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4156 |
WARNING: in order to avoid zombie processes (on unix), |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4157 |
you may have to fetch the processes exitstatus with |
3796 | 4158 |
OperatingSystem>>getStatusOfProcess:aProcessId |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4159 |
if the signal terminates that process." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4160 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4161 |
"/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4162 |
"/ either invalid argument (non-integers) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4163 |
"/ or not supported by OS |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4164 |
"/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4165 |
^ self primitiveFailed |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4166 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4167 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4168 |
startSpyTimer |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4169 |
"trigger a spyInterrupt, to be signalled after some short (virtual) time. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4170 |
This is used by the old MessageTally for profiling. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4171 |
Should be changed to use real profiling timer if available. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4172 |
On systems, where no virtual timer is available, use the real timer |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4173 |
(which is of course less correct). |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4174 |
OBSOLETE: the new messageTally runs as a high prio process, not using |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4175 |
spy interrupts." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4176 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4177 |
^ false |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4178 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4179 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4180 |
stopSpyTimer |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4181 |
"stop spy timing - disable spy timer. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4182 |
OBSOLETE: the new messageTally runs as a high prio process, not using |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4183 |
spy interrupts." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4184 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4185 |
^ false |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4186 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4187 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4188 |
terminateProcess:processId |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4189 |
"terminate a unix process. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4190 |
The process has a chance to do some cleanup. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4191 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4192 |
WARNING: in order to avoid zombie processes (on unix), |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4193 |
you may have to fetch the processes exitstatus with |
3796 | 4194 |
OperatingSystem>>getStatusOfProcess:aProcessId." |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4195 |
|
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4196 |
self primTerminateProcess:processId |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4197 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4198 |
"Modified: / 28.12.1995 / 15:05:37 / stefan" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4199 |
"Modified: / 27.1.1998 / 20:05:47 / cg" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4200 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4201 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4202 |
terminateProcessGroup:processGroupId |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4203 |
"terminate a unix process group. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4204 |
The process has a chance to do some cleanup. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4205 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4206 |
WARNING: in order to avoid zombie processes (on unix), |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4207 |
you may have to fetch the processes exitstatus with |
3796 | 4208 |
OperatingSystem>>getStatusOfProcess:aProcessId." |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4209 |
|
3741 | 4210 |
self primTerminateProcessGroup:processGroupId |
4211 |
"/ ^ UnsupportedOperationSignal raise |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4212 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4213 |
"Modified: / 28.12.1995 / 15:05:37 / stefan" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4214 |
"Created: / 23.4.1996 / 16:40:34 / stefan" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4215 |
"Modified: / 27.1.1998 / 20:05:59 / cg" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4216 |
! ! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4217 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4218 |
!Win32OperatingSystem class methodsFor:'ipc support - UNIX'! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4219 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4220 |
makePipe |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4221 |
"make a pipe, return array with two filedescriptors on success, |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4222 |
nil on failure. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4223 |
This is a lowLevel entry, not for public use. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4224 |
See ExternalStream>>makePipe for a more user-friendly, public interface." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4225 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4226 |
|fd1 fd2| |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4227 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4228 |
%{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4229 |
HANDLE pipeRead = (HANDLE)0; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4230 |
HANDLE pipeWrite = (HANDLE)0; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4231 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4232 |
SECURITY_ATTRIBUTES process; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4233 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4234 |
process.nLength = sizeof( process ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4235 |
process.lpSecurityDescriptor = NULL; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4236 |
process.bInheritHandle = TRUE; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4237 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4238 |
if( ! CreatePipe( &pipeRead, &pipeWrite, &process, 0 ) ) { |
3861
edb631f0295b
handle more win32 error codes in eNum2Text
Claus Gittinger <cg@exept.de>
parents:
3846
diff
changeset
|
4239 |
@global(LastErrorNumber) = __MKSMALLINT( __WIN32_ERR(GetLastError()) ); |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4240 |
RETURN ( nil ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4241 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4242 |
|
3810 | 4243 |
#ifdef USE_HANDLES |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4244 |
fd1 = __MKEXTERNALADDRESS(pipeRead); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4245 |
fd2 = __MKEXTERNALADDRESS(pipeWrite); |
3810 | 4246 |
#else |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4247 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4248 |
* make fileDescriptors from handles |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4249 |
*/ |
3817
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
4250 |
#ifdef PROCESSDEBUGWIN32 |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4251 |
printf("piperead %x\n",pipeRead); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4252 |
printf("pipewrite %x\n",pipeWrite); |
3817
5d1719e862c7
more file ops (Attribute queries) use wrapCalls (better behavior
Claus Gittinger <cg@exept.de>
parents:
3810
diff
changeset
|
4253 |
#endif |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4254 |
fd1 = __MKSMALLINT(_open_osfhandle(pipeRead, O_BINARY)); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4255 |
fd2 = __MKSMALLINT(_open_osfhandle(pipeWrite, O_BINARY)); |
3810 | 4256 |
#endif |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4257 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4258 |
fd1 notNil ifTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4259 |
^ Array with:fd1 with:fd2. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4260 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4261 |
^ nil |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4262 |
! ! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4263 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4264 |
!Win32OperatingSystem class methodsFor:'misc'! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4265 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4266 |
closePid:pid |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4267 |
"free pid resource" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4268 |
%{ |
3810 | 4269 |
if (__isExternalAddress(pid) ) { |
4270 |
if (_HANDLEVal(pid) != 0) { |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4271 |
#ifdef PROCESSDEBUGWIN32 |
3810 | 4272 |
printf("Close ProcessHandle %x\n",_HANDLEVal(pid)); |
4273 |
#endif |
|
4274 |
CloseHandle(_HANDLEVal(pid)); |
|
4275 |
_HANDLEVal(pid) = 0; |
|
4276 |
} |
|
4277 |
} |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4278 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4279 |
^ true. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4280 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4281 |
"Created: 28.1.1998 / 14:23:04 / md" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4282 |
"Modified: 28.1.1998 / 14:27:18 / md" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4283 |
! ! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4284 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4285 |
!Win32OperatingSystem class methodsFor:'os queries'! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4286 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4287 |
executableFileExtensions |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4288 |
"return a collection of extensions for executable program files. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4289 |
Only req'd for msdos like systems ..." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4290 |
|
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4291 |
^ #('com' 'exe') |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4292 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4293 |
"Created: 2.5.1997 / 11:42:29 / cg" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4294 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4295 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4296 |
getDomainName |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4297 |
"return the domain this host is in. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4298 |
Notice: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4299 |
not all systems support this; on some, 'unknown' is returned." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4300 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4301 |
|name idx hostName| |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4302 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4303 |
DomainName notNil ifTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4304 |
^ DomainName |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4305 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4306 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4307 |
%{ /* STACK: 2048 */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4308 |
#if defined(HAS_GETDOMAINNAME) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4309 |
char buffer[128]; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4310 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4311 |
if (getdomainname(buffer, sizeof(buffer)) == 0) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4312 |
name = __MKSTRING(buffer); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4313 |
} |
3799 | 4314 |
#endif |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4315 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4316 |
name isNil ifTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4317 |
name := self getEnvironment:'DOMAIN'. |
3802 | 4318 |
name isNil ifTrue:[ |
4319 |
name := self getEnvironment:'DOMAINNAME'. |
|
4320 |
] |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4321 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4322 |
name isNil ifTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4323 |
"/ sometimes, we can extract the domainName from the hostName ... |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4324 |
hostName := self getHostName. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4325 |
hostName notNil ifTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4326 |
idx := hostName indexOf:$.. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4327 |
idx ~~ 0 ifTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4328 |
name := hostName copyFrom:idx+1. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4329 |
] |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4330 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4331 |
name isNil ifTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4332 |
'Win32OperatingSystem [warning]: cannot find out domainname' errorPrintCR. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4333 |
name := 'unknown'. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4334 |
] |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4335 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4336 |
DomainName := name. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4337 |
^ name |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4338 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4339 |
" |
3796 | 4340 |
OperatingSystem getDomainName |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4341 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4342 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4343 |
"Modified: 26.4.1996 / 10:04:54 / stefan" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4344 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4345 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4346 |
getEnvironment:aStringOrSymbol |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4347 |
"get an environment string" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4348 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4349 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4350 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4351 |
char *env; |
3741 | 4352 |
#ifndef __BORLANDC__ |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4353 |
extern char *getenv(); |
3741 | 4354 |
#endif |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4355 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4356 |
if (__isString(aStringOrSymbol) || __isSymbol(aStringOrSymbol)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4357 |
char buff[512]; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4358 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4359 |
env = NULL; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4360 |
if (GetEnvironmentVariable(__stringVal(aStringOrSymbol), |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4361 |
buff, |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4362 |
sizeof(buff)-1)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4363 |
env = buff; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4364 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4365 |
if (env) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4366 |
RETURN ( __MKSTRING(env) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4367 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4368 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4369 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4370 |
. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4371 |
^ nil |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4372 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4373 |
" |
3796 | 4374 |
OperatingSystem getEnvironment:'LANG' |
4375 |
OperatingSystem getEnvironment:'LOGIN' |
|
4376 |
OperatingSystem getEnvironment:'HOME' |
|
4377 |
OperatingSystem getEnvironment:'NNTPSERVER' |
|
4378 |
OperatingSystem getEnvironment:'MAIL' |
|
4379 |
OperatingSystem getEnvironment:'PATH' |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4380 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4381 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4382 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4383 |
getHostName |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4384 |
"return the hostname we are running on - if there is |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4385 |
a HOST environment variable, we are much faster here ... |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4386 |
Notice: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4387 |
not all systems support this; on some, 'unknown' is returned." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4388 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4389 |
|name idx| |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4390 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4391 |
HostName notNil ifTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4392 |
^ HostName |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4393 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4394 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4395 |
%{ /* STACK: 2048 */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4396 |
#if defined(HAS_GETHOSTNAME) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4397 |
char buffer[256]; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4398 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4399 |
if (gethostname(buffer, sizeof(buffer)) == 0) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4400 |
name = __MKSTRING(buffer); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4401 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4402 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4403 |
# if defined(HAS_UNAME) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4404 |
struct utsname ubuff; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4405 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4406 |
if (uname(&ubuff) >= 0) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4407 |
name = __MKSTRING(ubuff.nodename); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4408 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4409 |
# else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4410 |
# if defined(HAS_SYSINFO) && defined(SI_HOSTNAME) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4411 |
char buffer[256]; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4412 |
int ret; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4413 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4414 |
if ((ret = sysinfo(SI_HOSTNAME, buffer, sizeof(buffer))) >= 0 && ret <= sizeof(buffer)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4415 |
name = __MKSTRING(buffer); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4416 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4417 |
# else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4418 |
# ifdef WIN32 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4419 |
char buffer[128]; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4420 |
int buffSize = sizeof(buffer); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4421 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4422 |
if (GetComputerName(buffer, &buffSize) == TRUE) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4423 |
name = __MKSTRING(buffer); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4424 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4425 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4426 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4427 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4428 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4429 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4430 |
name isNil ifTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4431 |
name := self getEnvironment:'HOST'. |
3802 | 4432 |
name isNil ifTrue:[ |
4433 |
name := self getEnvironment:'HOSTNAME'. |
|
4434 |
] |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4435 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4436 |
name isNil ifTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4437 |
'Win32OperatingSystem [warning]: cannot find out hostname' errorPrintCR. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4438 |
name := 'unknown'. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4439 |
] ifFalse:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4440 |
"/ on some systems, the hostname already contains the domain. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4441 |
"/ decompose it here. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4442 |
idx := name indexOf:$.. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4443 |
idx ~~ 0 ifTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4444 |
DomainName := name copyFrom:(idx+1). |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4445 |
name := name copyTo:(idx-1). |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4446 |
] |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4447 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4448 |
HostName := name. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4449 |
^ name |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4450 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4451 |
" |
3796 | 4452 |
OperatingSystem getHostName |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4453 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4454 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4455 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4456 |
getLocaleInfo |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4457 |
"return a dictionary filled with values from the locale information; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4458 |
Not all fields may be present, depending on the OS's setup and capabilities. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4459 |
Possible fields are: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4460 |
decimalPoint <String> |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4461 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4462 |
thousandsSep <String> |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4463 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4464 |
internationalCurrencySymbol <String> |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4465 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4466 |
currencySymbol <String> |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4467 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4468 |
monetaryDecimalPoint <String> |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4469 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4470 |
monetaryThousandsSeparator <String> |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4471 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4472 |
positiveSign <String> |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4473 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4474 |
negativeSign <String> |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4475 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4476 |
internationalFractionalDigits <Integer> |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4477 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4478 |
fractionalDigits <Integer> |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4479 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4480 |
positiveSignPrecedesCurrencySymbol <Boolean> |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4481 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4482 |
negativeSignPrecedesCurrencySymbol <Boolean> |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4483 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4484 |
positiveSignSeparatedBySpaceFromCurrencySymbol <Boolean> |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4485 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4486 |
negativeSignSeparatedBySpaceFromCurrencySymbol <Boolean> |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4487 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4488 |
positiveSignPosition <Symbol> |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4489 |
one of: #parenthesesAround, |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4490 |
#signPrecedes, |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4491 |
#signSuceeds, |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4492 |
#signPrecedesCurrencySymbol, |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4493 |
#signSuceedsCurrencySymbol |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4494 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4495 |
negativeSignPosition <like above> |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4496 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4497 |
it is up to the application to deal with undefined values. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4498 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4499 |
Notice, that (for now), the system does not use this information; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4500 |
it should be used by applications as required. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4501 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4502 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4503 |
|info val| |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4504 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4505 |
LocaleInfo notNil ifTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4506 |
"/ return the internal info; useful on systems which do not |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4507 |
"/ support this. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4508 |
^ LocaleInfo |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4509 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4510 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4511 |
info := IdentityDictionary new. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4512 |
%{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4513 |
char *decimalPoint; /* something like "." (US) or "," (german) */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4514 |
char *thousandsSep; /* something like "," (US) or "." (german) */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4515 |
char *intCurrencySymbol; /* international currency symbol; something like "USD " "DM " */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4516 |
char *currencySymbol; /* local currency symbol; something like "USD " "DM " */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4517 |
char *monDecimalPoint; /* money: decimal point */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4518 |
char *monThousandsSep; /* money: thousands sep */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4519 |
char *positiveSign; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4520 |
char *negativeSign; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4521 |
int intFractDigits; /* money: international digits after decPoint */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4522 |
int fractDigits; /* money: local digits after decPoint */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4523 |
int csPosPrecedes; /* money: 1 if currency symbol precedes a positive value; 0 if it sceeds */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4524 |
int csNegPrecedes; /* money: 1 if currency symbol precedes a negative value; 0 if it sceeds */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4525 |
int csPosSepBySpace; /* money: 1 if currency symbol should be separated by a space from a positive value; 0 if no space */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4526 |
int csNegSepBySpace; /* money: 1 if currency symbol should be separated by a space from a negative value; 0 if no space */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4527 |
int csPosSignPosition; /* money: 0: ()'s around the value & currency symbol */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4528 |
int csNegSignPosition; /* 1: sign precedes the value & currency symbol */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4529 |
/* 2: sign succeeds the value & currency symbol */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4530 |
/* 3: sign immediately precedes the currency symbol */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4531 |
/* 4: sign immediately suceeds the currency symbol */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4532 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4533 |
#if defined(HAS_LOCALECONV) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4534 |
struct lconv *conf; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4535 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4536 |
conf = localeconv(); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4537 |
if (conf) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4538 |
decimalPoint = conf->decimal_point; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4539 |
thousandsSep = conf->thousands_sep; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4540 |
intCurrencySymbol = conf->int_curr_symbol; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4541 |
currencySymbol = conf->currency_symbol; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4542 |
monDecimalPoint = conf->mon_decimal_point; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4543 |
monThousandsSep = conf->mon_thousands_sep; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4544 |
positiveSign = conf->positive_sign; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4545 |
negativeSign = conf->negative_sign; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4546 |
intFractDigits = conf->int_frac_digits; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4547 |
fractDigits = conf->frac_digits; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4548 |
csPosPrecedes = conf->p_cs_precedes; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4549 |
csNegPrecedes = conf->n_cs_precedes; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4550 |
csPosSepBySpace = conf->p_sep_by_space; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4551 |
csNegSepBySpace = conf->n_sep_by_space; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4552 |
csPosSignPosition = conf->p_sign_posn; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4553 |
csNegSignPosition = conf->n_sign_posn; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4554 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4555 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4556 |
decimalPoint = (char *)0; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4557 |
thousandsSep = (char *)0; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4558 |
intCurrencySymbol = (char *)0; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4559 |
currencySymbol = (char *)0; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4560 |
monDecimalPoint = (char *)0; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4561 |
monThousandsSep = (char *)0; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4562 |
positiveSign = (char *)0; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4563 |
negativeSign =(char *)0; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4564 |
intFractDigits = -1; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4565 |
fractDigits = -1; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4566 |
csPosPrecedes = -1; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4567 |
csNegPrecedes = -1; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4568 |
csPosSepBySpace = -1; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4569 |
csNegSepBySpace = -1; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4570 |
csPosSignPosition = -1; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4571 |
csNegSignPosition = -1; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4572 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4573 |
if (decimalPoint) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4574 |
val = __MKSTRING(decimalPoint); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4575 |
__AT_PUT_(info, @symbol(decimalPoint), val); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4576 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4577 |
if (thousandsSep) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4578 |
val = __MKSTRING(thousandsSep); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4579 |
__AT_PUT_(info, @symbol(thousandsSeparator), val); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4580 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4581 |
if (intCurrencySymbol) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4582 |
val = __MKSTRING(intCurrencySymbol); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4583 |
__AT_PUT_(info, @symbol(internationCurrencySymbol), val); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4584 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4585 |
if (currencySymbol) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4586 |
val = __MKSTRING(currencySymbol); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4587 |
__AT_PUT_(info, @symbol(currencySymbol), val); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4588 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4589 |
if (monDecimalPoint) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4590 |
val = __MKSTRING(monDecimalPoint); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4591 |
__AT_PUT_(info, @symbol(monetaryDecimalPoint), val); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4592 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4593 |
if (monThousandsSep) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4594 |
val = __MKSTRING(monThousandsSep); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4595 |
__AT_PUT_(info, @symbol(monetaryThousandsSeparator), val); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4596 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4597 |
if (positiveSign) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4598 |
val = __MKSTRING(positiveSign); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4599 |
__AT_PUT_(info, @symbol(positiveSign), val); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4600 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4601 |
if (negativeSign) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4602 |
val = __MKSTRING(negativeSign); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4603 |
__AT_PUT_(info, @symbol(negativeSign), val); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4604 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4605 |
if (intFractDigits >= 0) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4606 |
__AT_PUT_(info, @symbol(internationalFractionalDigits), __MKSMALLINT(intFractDigits)); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4607 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4608 |
if (fractDigits >= 0) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4609 |
__AT_PUT_(info, @symbol(fractionalDigits), __MKSMALLINT(fractDigits)); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4610 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4611 |
if (csPosPrecedes >= 0) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4612 |
if (csPosPrecedes == 0) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4613 |
val = false; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4614 |
} else { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4615 |
val = true; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4616 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4617 |
__AT_PUT_(info, @symbol(positiveSignPrecedesCurrencySymbol), val ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4618 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4619 |
if (csNegPrecedes >= 0) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4620 |
if (csNegPrecedes == 0) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4621 |
val = false; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4622 |
} else { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4623 |
val = true; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4624 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4625 |
__AT_PUT_(info, @symbol(negativeSignPrecedesCurrencySymbol), val ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4626 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4627 |
if (csPosSepBySpace >= 0) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4628 |
if (csPosSepBySpace == 0) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4629 |
val = false; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4630 |
} else { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4631 |
val = true; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4632 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4633 |
__AT_PUT_(info, @symbol(positiveSignSeparatedBySpaceFromCurrencySymbol), val); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4634 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4635 |
if (csNegSepBySpace >= 0) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4636 |
if (csNegSepBySpace == 0) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4637 |
val = false; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4638 |
} else { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4639 |
val = true; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4640 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4641 |
__AT_PUT_(info, @symbol(negativeSignSeparatedBySpaceFromCurrencySymbol), val); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4642 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4643 |
switch (csPosSignPosition) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4644 |
case 0: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4645 |
val = @symbol(parenthesesAround); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4646 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4647 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4648 |
case 1: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4649 |
val = @symbol(signPrecedes); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4650 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4651 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4652 |
case 2: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4653 |
val = @symbol(signSuceeds); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4654 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4655 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4656 |
case 3: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4657 |
val = @symbol(signPrecedesCurrencySymbol); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4658 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4659 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4660 |
case 4: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4661 |
val = @symbol(signSuceedsCurrencySymbol); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4662 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4663 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4664 |
default: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4665 |
val = nil; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4666 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4667 |
if (val != nil) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4668 |
__AT_PUT_(info, @symbol(positiveSignPosition), val); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4669 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4670 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4671 |
switch (csNegSignPosition) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4672 |
case 0: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4673 |
val = @symbol(parenthesesAround); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4674 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4675 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4676 |
case 1: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4677 |
val = @symbol(signPrecedes); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4678 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4679 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4680 |
case 2: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4681 |
val = @symbol(signSuceeds); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4682 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4683 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4684 |
case 3: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4685 |
val = @symbol(signPrecedesCurrencySymbol); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4686 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4687 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4688 |
case 4: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4689 |
val = @symbol(signSuceedsCurrencySymbol); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4690 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4691 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4692 |
default: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4693 |
val = nil; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4694 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4695 |
if (val != nil) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4696 |
__AT_PUT_(info, @symbol(negativeSignPosition), val); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4697 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4698 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4699 |
^ info |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4700 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4701 |
" |
3796 | 4702 |
OperatingSystem getLocaleInfo |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4703 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4704 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4705 |
"Created: 23.12.1995 / 14:19:20 / cg" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4706 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4707 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4708 |
getProcessId |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4709 |
"return the (unix-)processId" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4710 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4711 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4712 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4713 |
int pid = 0; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4714 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4715 |
pid = GetCurrentProcessId() & 0x3FFFFFFF; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4716 |
RETURN ( __MKSMALLINT(pid) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4717 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4718 |
" |
3796 | 4719 |
OperatingSystem getProcessId |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4720 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4721 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4722 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4723 |
getSystemID |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4724 |
"if supported by the OS, return the systemID; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4725 |
a unique per machine identification. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4726 |
WARNING: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4727 |
not all systems support this; on some, 'unknown' is returned." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4728 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4729 |
%{ /* NO_CONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4730 |
#if defined(HAS_GETHOSTID) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4731 |
int runningId; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4732 |
OBJ arr; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4733 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4734 |
runningId = gethostid(); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4735 |
arr = __BYTEARRAY_UNINITIALIZED_NEW_INT(4); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4736 |
*(int *)(__ByteArrayInstPtr(arr)->ba_element) = runningId; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4737 |
RETURN (arr); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4738 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4739 |
#if defined(HAS_SYSINFO) && defined(SI_HW_SERIAL) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4740 |
{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4741 |
char buffer[128]; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4742 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4743 |
buffer[0] = 0; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4744 |
if (sysinfo(SI_HW_SERIAL, buffer, sizeof(buffer))) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4745 |
buffer[127] = 0; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4746 |
if (strlen(buffer) > 0) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4747 |
RETURN(__MKSTRING(buffer)); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4748 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4749 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4750 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4751 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4752 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4753 |
^ 'unknown' |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4754 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4755 |
" |
3796 | 4756 |
OperatingSystem getSystemID |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4757 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4758 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4759 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4760 |
getSystemInfo |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4761 |
"return info on the system weare running on. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4762 |
If the system supports the uname system call, that info is returned; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4763 |
otherwise, some simulated info is returned. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4764 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4765 |
WARNING: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4766 |
Do not depend on the amount and contents of the returned information, some |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4767 |
systems may return more/less than others. Also, the contents depends on the |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4768 |
OS, for example, linux returns 'ix86', while WIN32 returns 'x86'. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4769 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4770 |
This method is mainly provided to augment error reports with some system |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4771 |
information. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4772 |
(in case of system/version specific OS errors, conditional workarounds and patches |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4773 |
may be based upon this info). |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4774 |
Your application should NOT depend upon this in any way. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4775 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4776 |
The returned info may (or may not) contain: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4777 |
#system -> some operating system identification (irix, Linux, nt, win32s ...) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4778 |
#version -> OS version (some os version identification) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4779 |
#release -> OS release (3.5, 1.2.1 ...) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4780 |
#node -> some host identification (hostname) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4781 |
#domain -> domain name (hosts domain) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4782 |
#machine -> type of machine (i586, mips ...) |
3846
1a085f3d011e
added more system info (ram size etc.)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
4783 |
|
1a085f3d011e
added more system info (ram size etc.)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
4784 |
win32: |
1a085f3d011e
added more system info (ram size etc.)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
4785 |
#physicalRam -> total amount of physical memory |
1a085f3d011e
added more system info (ram size etc.)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
4786 |
#freeRam -> amount of free memory |
1a085f3d011e
added more system info (ram size etc.)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
4787 |
#swapSize -> size of swapSpace (page file) |
1a085f3d011e
added more system info (ram size etc.)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
4788 |
#freeSwap -> free bytes in swapSpace |
1a085f3d011e
added more system info (ram size etc.)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
4789 |
#virtualRam -> total amount of virtual memory |
1a085f3d011e
added more system info (ram size etc.)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
4790 |
#freeVirtual -> amount of free virtual memory |
1a085f3d011e
added more system info (ram size etc.)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
4791 |
" |
1a085f3d011e
added more system info (ram size etc.)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
4792 |
|
1a085f3d011e
added more system info (ram size etc.)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
4793 |
|sys node rel ver mach dom mtyp brel info arch |
1a085f3d011e
added more system info (ram size etc.)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
4794 |
physicalRam freeRam swapSize freeSwap |
1a085f3d011e
added more system info (ram size etc.)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
4795 |
virtualRam freeVirtual| |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4796 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4797 |
%{ /* STACK: 4096 */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4798 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4799 |
char vsnBuffer[32]; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4800 |
char *s; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4801 |
int winVer; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4802 |
DWORD vsn; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4803 |
SYSTEM_INFO sysInfo; |
3846
1a085f3d011e
added more system info (ram size etc.)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
4804 |
MEMORYSTATUS memStatus; |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4805 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4806 |
vsn = GetVersion(); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4807 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4808 |
if (HIWORD(vsn) & 0x8000) { |
3810 | 4809 |
s = "win95"; |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4810 |
} else { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4811 |
s = "nt"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4812 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4813 |
sys = __MKSTRING(s); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4814 |
winVer = LOWORD(vsn); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4815 |
sprintf(vsnBuffer, "%d.%d", LOBYTE(winVer), HIBYTE(winVer)); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4816 |
rel = __MKSTRING(vsnBuffer); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4817 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4818 |
GetSystemInfo(&sysInfo); |
3846
1a085f3d011e
added more system info (ram size etc.)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
4819 |
memStatus.dwLength = sizeof(memStatus); |
1a085f3d011e
added more system info (ram size etc.)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
4820 |
GlobalMemoryStatus(&memStatus); |
1a085f3d011e
added more system info (ram size etc.)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
4821 |
|
1a085f3d011e
added more system info (ram size etc.)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
4822 |
physicalRam = __MKUINT(memStatus.dwTotalPhys); |
1a085f3d011e
added more system info (ram size etc.)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
4823 |
freeRam = __MKUINT(memStatus.dwAvailPhys); |
1a085f3d011e
added more system info (ram size etc.)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
4824 |
swapSize = __MKUINT(memStatus.dwTotalPageFile); |
1a085f3d011e
added more system info (ram size etc.)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
4825 |
freeSwap = __MKUINT(memStatus.dwAvailPageFile); |
1a085f3d011e
added more system info (ram size etc.)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
4826 |
virtualRam = __MKUINT(memStatus.dwTotalVirtual); |
1a085f3d011e
added more system info (ram size etc.)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
4827 |
freeVirtual = __MKUINT(memStatus.dwAvailVirtual); |
1a085f3d011e
added more system info (ram size etc.)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
4828 |
|
3572 | 4829 |
#ifdef __BORLANDC__ |
4830 |
switch (sysInfo.u.s.wProcessorArchitecture) |
|
4831 |
#else |
|
4832 |
switch (sysInfo.wProcessorArchitecture) |
|
4833 |
#endif |
|
4834 |
{ |
|
3810 | 4835 |
#ifdef PROCESSOR_ARCHITECTURE_INTEL |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4836 |
case PROCESSOR_ARCHITECTURE_INTEL: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4837 |
s = "intel"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4838 |
break; |
3810 | 4839 |
#endif |
4840 |
#ifdef PROCESSOR_ARCHITECTURE_MIPS |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4841 |
case PROCESSOR_ARCHITECTURE_MIPS: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4842 |
s = "mips"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4843 |
break; |
3810 | 4844 |
#endif |
4845 |
#ifdef PROCESSOR_ARCHITECTURE_ALPHA |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4846 |
case PROCESSOR_ARCHITECTURE_ALPHA: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4847 |
s = "alpha"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4848 |
break; |
3810 | 4849 |
#endif |
4850 |
#ifdef PROCESSOR_ARCHITECTURE_PPC |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4851 |
case PROCESSOR_ARCHITECTURE_PPC: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4852 |
s = "ppc"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4853 |
break; |
3810 | 4854 |
#endif |
4855 |
#ifdef PROCESSOR_ARCHITECTURE_ARM |
|
4856 |
case PROCESSOR_ARCHITECTURE_ARM: |
|
4857 |
s = "arm"; |
|
4858 |
break; |
|
4859 |
#endif |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4860 |
default: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4861 |
s = "unknown"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4862 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4863 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4864 |
arch = __MKSTRING(s); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4865 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4866 |
switch (sysInfo.dwProcessorType) { |
3810 | 4867 |
#ifdef PROCESSOR_INTEL_386 |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4868 |
case PROCESSOR_INTEL_386: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4869 |
s = "i386"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4870 |
break; |
3810 | 4871 |
#endif |
4872 |
#ifdef PROCESSOR_INTEL_486 |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4873 |
case PROCESSOR_INTEL_486: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4874 |
s = "i486"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4875 |
break; |
3810 | 4876 |
#endif |
4877 |
#ifdef PROCESSOR_INTEL_PENTIUM |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4878 |
case PROCESSOR_INTEL_PENTIUM: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4879 |
s = "i586"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4880 |
break; |
3810 | 4881 |
#endif |
4882 |
#ifdef PROCESSOR_INTEL_860 |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4883 |
case PROCESSOR_INTEL_860: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4884 |
s = "i860"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4885 |
break; |
3810 | 4886 |
#endif |
4887 |
#ifdef PROCESSOR_MIPS_R2000 |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4888 |
case PROCESSOR_MIPS_R2000: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4889 |
s = "r2000"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4890 |
break; |
3810 | 4891 |
#endif |
4892 |
#ifdef PROCESSOR_MIPS_R3000 |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4893 |
case PROCESSOR_MIPS_R3000: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4894 |
s = "r3000"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4895 |
break; |
3810 | 4896 |
#endif |
4897 |
#ifdef PROCESSOR_MIPS_R4000 |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4898 |
case PROCESSOR_MIPS_R4000: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4899 |
s = "r4000"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4900 |
break; |
3810 | 4901 |
#endif |
4902 |
#ifdef PROCESSOR_ALPHA_21064 |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4903 |
case PROCESSOR_ALPHA_21064: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4904 |
s = "alpha21064"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4905 |
break; |
3810 | 4906 |
#endif |
4907 |
#ifdef PROCESSOR_ARM_7TDMI |
|
4908 |
case PROCESSOR_ARM_7TDMI: |
|
4909 |
s = "arm70001"; |
|
4910 |
break; |
|
4911 |
#endif |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4912 |
default: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4913 |
sprintf(vsnBuffer, "%d", sysInfo.dwProcessorType); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4914 |
s = vsnBuffer; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4915 |
break; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4916 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4917 |
mach = __MKSTRING(s); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4918 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4919 |
sys isNil ifTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4920 |
sys := self getSystemType. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4921 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4922 |
node isNil ifTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4923 |
node := self getHostName. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4924 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4925 |
dom isNil ifTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4926 |
dom := self getDomainName. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4927 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4928 |
mach isNil ifTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4929 |
mach := self getCPUType. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4930 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4931 |
arch isNil ifTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4932 |
arch := 'unknown'. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4933 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4934 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4935 |
info := IdentityDictionary new. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4936 |
info at:#system put:sys. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4937 |
info at:#node put:node. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4938 |
rel notNil ifTrue:[info at:#release put:rel]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4939 |
ver notNil ifTrue:[info at:#version put:ver]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4940 |
mach notNil ifTrue:[info at:#machine put:mach]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4941 |
arch notNil ifTrue:[info at:#architecture put:arch]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4942 |
dom notNil ifTrue:[info at:#domain put:dom]. |
3846
1a085f3d011e
added more system info (ram size etc.)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
4943 |
physicalRam notNil ifTrue:[info at:#physicalRam put:physicalRam]. |
1a085f3d011e
added more system info (ram size etc.)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
4944 |
freeRam notNil ifTrue:[info at:#freeRam put:freeRam]. |
1a085f3d011e
added more system info (ram size etc.)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
4945 |
swapSize notNil ifTrue:[info at:#swapSize put:swapSize]. |
1a085f3d011e
added more system info (ram size etc.)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
4946 |
freeSwap notNil ifTrue:[info at:#freeSwap put:freeSwap]. |
1a085f3d011e
added more system info (ram size etc.)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
4947 |
virtualRam notNil ifTrue:[info at:#virtualRam put:virtualRam]. |
1a085f3d011e
added more system info (ram size etc.)
Claus Gittinger <cg@exept.de>
parents:
3842
diff
changeset
|
4948 |
freeVirtual notNil ifTrue:[info at:#freeVirtual put:freeVirtual]. |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4949 |
info at:#osType put:(self getOSType). |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4950 |
^ info |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4951 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4952 |
" |
3796 | 4953 |
OperatingSystem getSystemInfo |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4954 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4955 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4956 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4957 |
getSystemType |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4958 |
"return a string giving the type of system we're running on. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4959 |
This is almost the same as getOSType, but the returned string |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4960 |
is slightly different for some systems (i.e. iris vs. irix). |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4961 |
Dont depend on this - use getOSType. I dont really see a point |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4962 |
here ... |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4963 |
(except for slight differences between next/mach and other machs)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4964 |
|
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
4965 |
^ 'win32' |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4966 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4967 |
" |
3796 | 4968 |
OperatingSystem getSystemType |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4969 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4970 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4971 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4972 |
getWindowsDirectory |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4973 |
"internal interface - only for Windows based systems. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4974 |
Return the windows directory |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4975 |
(which - depending on the system - may be \WINNT, \WINDOWS or whatever) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4976 |
On non-windows systems, nil is returned." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4977 |
|
3741 | 4978 |
%{ /* xxLIMITEDSTACK(WIN32) */ |
3810 | 4979 |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4980 |
char buffer[MAXPATHLEN]; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4981 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4982 |
if (GetWindowsDirectory(buffer, MAXPATHLEN)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4983 |
RETURN (__MKSTRING(buffer)); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4984 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4985 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4986 |
^ nil |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4987 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4988 |
" |
3796 | 4989 |
OperatingSystem getWindowsDirectory |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4990 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4991 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4992 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4993 |
getWindowsSystemDirectory |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4994 |
"internal interface - only for Windows based systems. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4995 |
Return the windows system directory |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4996 |
(which - depending on the system - may be \WINNT\SYSTEM32, |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4997 |
\WINDOWS\SYSTEM or whatever) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4998 |
On non-windows systems, nil is returned." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4999 |
|
3741 | 5000 |
%{ /* xxLIMITEDSTACK(WIN32) */ |
3810 | 5001 |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5002 |
char buffer[MAXPATHLEN]; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5003 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5004 |
if (GetSystemDirectory(buffer, MAXPATHLEN)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5005 |
RETURN (__MKSTRING(buffer)); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5006 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5007 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5008 |
^ nil |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5009 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5010 |
" |
3796 | 5011 |
OperatingSystem getWindowsSystemDirectory |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5012 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5013 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5014 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5015 |
isMSDOSlike |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5016 |
"return true, if the OS we're running on is msdos like |
3792 | 5017 |
(in contrast to unix-like or vms-like). |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5018 |
This returns true for any of msdos, win32s, win95, |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5019 |
winNT and os/2." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5020 |
|
3792 | 5021 |
^ true |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5022 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5023 |
|
3828
18ba9b3f03fa
added isWINDOWSNTlike query;
Claus Gittinger <cg@exept.de>
parents:
3822
diff
changeset
|
5024 |
isMSWINDOWSNTlike |
18ba9b3f03fa
added isWINDOWSNTlike query;
Claus Gittinger <cg@exept.de>
parents:
3822
diff
changeset
|
5025 |
"This returns true if running in a Windows-NT system." |
18ba9b3f03fa
added isWINDOWSNTlike query;
Claus Gittinger <cg@exept.de>
parents:
3822
diff
changeset
|
5026 |
|
18ba9b3f03fa
added isWINDOWSNTlike query;
Claus Gittinger <cg@exept.de>
parents:
3822
diff
changeset
|
5027 |
%{ |
18ba9b3f03fa
added isWINDOWSNTlike query;
Claus Gittinger <cg@exept.de>
parents:
3822
diff
changeset
|
5028 |
if (__isWinNT) |
18ba9b3f03fa
added isWINDOWSNTlike query;
Claus Gittinger <cg@exept.de>
parents:
3822
diff
changeset
|
5029 |
RETURN(true); |
18ba9b3f03fa
added isWINDOWSNTlike query;
Claus Gittinger <cg@exept.de>
parents:
3822
diff
changeset
|
5030 |
%}. |
18ba9b3f03fa
added isWINDOWSNTlike query;
Claus Gittinger <cg@exept.de>
parents:
3822
diff
changeset
|
5031 |
^ false. |
18ba9b3f03fa
added isWINDOWSNTlike query;
Claus Gittinger <cg@exept.de>
parents:
3822
diff
changeset
|
5032 |
! |
18ba9b3f03fa
added isWINDOWSNTlike query;
Claus Gittinger <cg@exept.de>
parents:
3822
diff
changeset
|
5033 |
|
3830 | 5034 |
isMSWINDOWSlike |
5035 |
"return true, if running on a MS-Windows like system. |
|
5036 |
This returns true for any of win32s, win95 and winNT." |
|
5037 |
||
5038 |
^ true |
|
5039 |
! |
|
5040 |
||
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5041 |
maxFileNameLength |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5042 |
"return the max number of characters in a filename. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5043 |
CAVEAT: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5044 |
Actually, the following is somewhat wrong - some systems |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5045 |
support different sizes, depending on the volume. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5046 |
We return a somewhat conservative number here. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5047 |
Another entry, to query for volume specific max |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5048 |
will be added in the future." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5049 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5050 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5051 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5052 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5053 |
* TODO: newer systems provide a query function for this ... use it |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5054 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5055 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5056 |
* mhmh - depends on the filesystem type |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5057 |
*/ |
3572 | 5058 |
RETURN ( __MKSMALLINT(MAXFILELEN) ); |
5059 |
%} |
|
5060 |
" |
|
5061 |
OperatingSystem maxFileNameLength |
|
5062 |
" |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5063 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5064 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5065 |
maxPathLength |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5066 |
"return the max number of characters in a pathName." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5067 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5068 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5069 |
RETURN ( __MKSMALLINT(MAXPATHLEN) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5070 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5071 |
" |
3572 | 5072 |
OperatingSystem maxPathLength |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5073 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5074 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5075 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5076 |
pathSeparator |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5077 |
"return the character which separates items in the PATH variable" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5078 |
|
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5079 |
^ $; |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5080 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5081 |
"Created: 2.5.1997 / 11:36:47 / cg" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5082 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5083 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5084 |
platformName |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5085 |
"return a string describing the OS platform very we're running on. |
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5086 |
This returns #unix for all unix derivatives, |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5087 |
#os2, #win32, #vms or #mac for the others. |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5088 |
I.e. it is much less specific than getOSType or getSystemType." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5089 |
|
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5090 |
^ #win32 |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5091 |
|
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5092 |
" |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5093 |
OperatingSystem platformName |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5094 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5095 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5096 |
"Modified: 20.6.1997 / 17:37:26 / cg" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5097 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5098 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5099 |
setLocaleInfo:anInfoDictionary |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5100 |
"set the locale information; if set, this oerrides the OS's settings. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5101 |
(internal in ST/X only - the OS's settings remain unaffected) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5102 |
See description of fields in #getLocaleInfo. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5103 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5104 |
Notice, that (for now), the system does not use this information; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5105 |
it should be used by applications as required." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5106 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5107 |
LocaleInfo := anInfoDictionary |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5108 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5109 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5110 |
|d| |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5111 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5112 |
d := IdentityDictionary new. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5113 |
d at:#decimalPoint put:'.' . |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5114 |
d at:#thousandsSeparator put:',' . |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5115 |
d at:#currencySymbol put:'USD' . |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5116 |
d at:#monetaryDecimalPoint put:'.' . |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5117 |
d at:#monetaryThousandsSeparator put:'.' . |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5118 |
d at:#fractionalDigits put:2 . |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5119 |
d at:#positiveSign put:'+' . |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5120 |
d at:#negativeSign put:'-' . |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5121 |
d at:#positiveSignPrecedesCurrencySymbol put:true . |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5122 |
d at:#negativeSignPrecedesCurrencySymbol put:false . |
3796 | 5123 |
OperatingSystem setLocaleInfo:d |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5124 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5125 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5126 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5127 |
supportsChildInterrupts |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5128 |
"return true, if the OS supports childProcess termination signalling |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5129 |
through interrupts (i.e. SIGCHILD)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5130 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5131 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5132 |
#if defined(SIGCHLD) || defined(SIGCLD) || defined(__VMS__) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5133 |
RETURN (true); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5134 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5135 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5136 |
^ false |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5137 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5138 |
" |
3796 | 5139 |
OperatingSystem supportsChildInterrupts |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5140 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5141 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5142 |
|
3819 | 5143 |
supportsFileOwnerGroups |
5144 |
"return true, if the OS's file system supports file |
|
5145 |
group ownership - all OS's except windows do" |
|
5146 |
||
5147 |
^ false |
|
5148 |
||
5149 |
"Created: / 10.9.1998 / 17:57:03 / cg" |
|
5150 |
! |
|
5151 |
||
5152 |
supportsFileOwners |
|
5153 |
"return true, if the OS's file system supports file |
|
5154 |
ownership - all OS's except windows do" |
|
5155 |
||
5156 |
^ false |
|
5157 |
||
5158 |
"Created: / 10.9.1998 / 17:55:16 / cg" |
|
5159 |
"Modified: / 10.9.1998 / 17:57:11 / cg" |
|
5160 |
! |
|
5161 |
||
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5162 |
supportsIOInterrupts |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5163 |
"return true, if the OS supports IO availability interrupts |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5164 |
(i.e. SIGPOLL/SIGIO). |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5165 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5166 |
Currently, this mechanism does not work on all |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5167 |
systems ... |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5168 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5169 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5170 |
^ false |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5171 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5172 |
" |
3796 | 5173 |
OperatingSystem supportsIOInterrupts |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5174 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5175 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5176 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5177 |
supportsNonBlockingIO |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5178 |
"return true, if the OS supports nonblocking IO." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5179 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5180 |
^ false |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5181 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5182 |
" |
3796 | 5183 |
OperatingSystem supportsNonBlockingIO |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5184 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5185 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5186 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5187 |
supportsSelect |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5188 |
"return true, if the OS supports selecting on multiple |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5189 |
filedescriptors via select. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5190 |
If false is returned, ProcessorScheduler will poll in 50ms |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5191 |
intervals for I/O becoming ready." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5192 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5193 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5194 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5195 |
# if defined(WIN32S) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5196 |
RETURN (false); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5197 |
# else |
3741 | 5198 |
/* RETURN (false); /* for now ... */ |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5199 |
RETURN (true); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5200 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5201 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5202 |
%}. |
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5203 |
^ false |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5204 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5205 |
" |
3796 | 5206 |
OperatingSystem supportsSelect |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5207 |
" |
3902 | 5208 |
! |
5209 |
||
5210 |
supportsVolumes |
|
5211 |
"return true, if the OS supports disk volumes. |
|
5212 |
False is returned for UNIX, true for MSDOS and VMS" |
|
5213 |
||
5214 |
^ true |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5215 |
! ! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5216 |
|
3559 | 5217 |
!Win32OperatingSystem class methodsFor:'private'! |
5218 |
||
5219 |
osProcessStatusClass |
|
5220 |
^ OSProcessStatus |
|
5221 |
||
5222 |
"Created: / 12.6.1998 / 16:30:43 / cg" |
|
5223 |
! ! |
|
5224 |
||
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5225 |
!Win32OperatingSystem class methodsFor:'time and date'! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5226 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5227 |
computeDatePartsOf:osTime for:aBlock |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5228 |
"compute year, month and day from the OS time, osTime |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5229 |
and evaluate the argument, a 3-arg block with these. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5230 |
Conversion is to localtime including any daylight saving adjustments." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5231 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5232 |
|year month day osSeconds| |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5233 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5234 |
osSeconds := osTime // 1000. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5235 |
%{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5236 |
struct tm* tmPtr; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5237 |
INT t; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5238 |
TIME_T tt; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5239 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5240 |
t = __longIntVal(osSeconds); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5241 |
tt = (TIME_T)t; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5242 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5243 |
tmPtr = localtime(&tt); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5244 |
year = __MKSMALLINT(tmPtr->tm_year + 1900); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5245 |
month = __MKSMALLINT(tmPtr->tm_mon + 1); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5246 |
day = __MKSMALLINT(tmPtr->tm_mday); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5247 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5248 |
aBlock value:year value:month value:day |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5249 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5250 |
" |
3796 | 5251 |
OperatingSystem computeDatePartsOf:0 for:[:y :m :d | |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5252 |
y printCR. m printCR. d printCR |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5253 |
] |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5254 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5255 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5256 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5257 |
computeOSTimeFromYear:y month:m day:d hour:h minute:min seconds:s millis:millis |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5258 |
"return the OS-dependent time for the given time and day. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5259 |
The arguments are assumed to be in localtime including |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5260 |
any daylight saving adjustings." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5261 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5262 |
|osSeconds| |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5263 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5264 |
%{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5265 |
struct tm tm; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5266 |
TIME_T t; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5267 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5268 |
if (__bothSmallInteger(y, m) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5269 |
&& __bothSmallInteger(d, h) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5270 |
&& __bothSmallInteger(min, s)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5271 |
tm.tm_hour = __intVal(h); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5272 |
tm.tm_min = __intVal(min); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5273 |
tm.tm_sec = __intVal(s); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5274 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5275 |
tm.tm_year = __intVal(y) - 1900; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5276 |
tm.tm_mon = __intVal(m) - 1; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5277 |
tm.tm_mday = __intVal(d); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5278 |
tm.tm_isdst = -1; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5279 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5280 |
t = mktime(&tm); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5281 |
osSeconds = __MKUINT((INT)t); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5282 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5283 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5284 |
osSeconds notNil ifTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5285 |
^ osSeconds * 1000 + millis |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5286 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5287 |
^ self primitiveFailed |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5288 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5289 |
" |
3796 | 5290 |
OperatingSystem computeOSTimeFromYear:1970 month:1 day:1 hour:0 minute:0 seconds:0 millis:0 |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5291 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5292 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5293 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5294 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5295 |
computeTimeAndDateFrom:osTime |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5296 |
"given an OS-dependent time in osTime, return an Array |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5297 |
containing (full-) year, month, day, hour, minute and seconds, |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5298 |
offset to UTC, daylight savings time flag, milliseconds, |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5299 |
dayInYear (1..) and dayInWeek (1..). |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5300 |
Conversion is to localtime including any daylight saving adjustments." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5301 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5302 |
|low hi year month day hours minutes seconds millis utcOffset |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5303 |
dst yDay wDay osSeconds ret| |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5304 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5305 |
millis := osTime \\ 1000. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5306 |
osSeconds := osTime // 1000. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5307 |
%{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5308 |
struct tm *tmPtr; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5309 |
struct tm *gmTmPtr; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5310 |
INT t; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5311 |
TIME_T tt; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5312 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5313 |
t = __longIntVal(osSeconds); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5314 |
tt = (TIME_T)t; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5315 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5316 |
tmPtr = localtime(&tt); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5317 |
hours = __MKSMALLINT(tmPtr->tm_hour); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5318 |
minutes = __MKSMALLINT(tmPtr->tm_min); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5319 |
seconds = __MKSMALLINT(tmPtr->tm_sec); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5320 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5321 |
year = __MKSMALLINT(tmPtr->tm_year + 1900); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5322 |
month = __MKSMALLINT(tmPtr->tm_mon + 1); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5323 |
day = __MKSMALLINT(tmPtr->tm_mday); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5324 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5325 |
yDay = __MKSMALLINT(tmPtr->tm_yday+1); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5326 |
wDay = __MKSMALLINT(tmPtr->tm_wday == 0 ? 7 : tmPtr->tm_wday); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5327 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5328 |
if (tmPtr->tm_isdst == 0) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5329 |
dst = false; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5330 |
utcOffset = __MKINT(TIMEZONE(tmPtr)); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5331 |
} else { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5332 |
dst = true; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5333 |
#ifdef HAS_ALTZONE |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5334 |
utcOffset = __MKINT(altzone); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5335 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5336 |
utcOffset = __MKINT(TIMEZONE(tmPtr) + 3600); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5337 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5338 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5339 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5340 |
"I would love to have SELF-like inline objects ..." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5341 |
ret := Array new:11. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5342 |
ret at:1 put:year. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5343 |
ret at:2 put:month. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5344 |
ret at:3 put:day. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5345 |
ret at:4 put:hours. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5346 |
ret at:5 put:minutes. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5347 |
ret at:6 put:seconds. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5348 |
ret at:7 put:utcOffset. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5349 |
ret at:8 put:dst. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5350 |
ret at:9 put:millis. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5351 |
ret at:10 put:yDay. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5352 |
ret at:11 put:wDay. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5353 |
^ ret |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5354 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5355 |
" |
3796 | 5356 |
OperatingSystem computeTimeAndDateFrom:0 |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5357 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5358 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5359 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5360 |
computeTimePartsOf:osTime for:aBlock |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5361 |
"compute hours, minutes, seconds and milliseconds from the osTime |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5362 |
and evaluate the argument, a 4-arg block with these. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5363 |
Conversion is to localtime including any daylight saving adjustments." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5364 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5365 |
|hours minutes seconds millis osSeconds| |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5366 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5367 |
osSeconds := osTime // 1000. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5368 |
millis := osTime \\ 1000. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5369 |
%{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5370 |
struct tm *tmPtr; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5371 |
INT t; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5372 |
TIME_T tt; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5373 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5374 |
t = __longIntVal(osSeconds); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5375 |
tt = (TIME_T)t; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5376 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5377 |
tmPtr = localtime(&tt); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5378 |
hours = __MKSMALLINT(tmPtr->tm_hour); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5379 |
minutes = __MKSMALLINT(tmPtr->tm_min); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5380 |
seconds = __MKSMALLINT(tmPtr->tm_sec); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5381 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5382 |
aBlock value:hours value:minutes value:seconds value:millis |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5383 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5384 |
" |
3796 | 5385 |
OperatingSystem computeTimePartsOf:100 for:[:h :m :s :milli | |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5386 |
h printCR. m printCR. s printCR. millis printCR |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5387 |
] |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5388 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5389 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5390 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5391 |
computeUTCTimeAndDateFrom:osTime |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5392 |
"given an OS-dependent time in osTime, return an Array |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5393 |
containing year, month, day, hour, minute and seconds, |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5394 |
offset to UTC, daylight savings time flag, milliseconds, |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5395 |
dayInYear (1..) and dayInWeek (1..). |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5396 |
Conversion is to UTC." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5397 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5398 |
|low hi year month day hours minutes seconds millis utcOffset |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5399 |
dst yDay wDay osSeconds ret| |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5400 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5401 |
millis := osTime \\ 1000. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5402 |
osSeconds := osTime // 1000. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5403 |
%{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5404 |
struct tm *tmPtr; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5405 |
struct tm *gmTmPtr; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5406 |
long t; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5407 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5408 |
t = __longIntVal(osSeconds); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5409 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5410 |
tmPtr = gmtime(&t); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5411 |
hours = __MKSMALLINT(tmPtr->tm_hour); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5412 |
minutes = __MKSMALLINT(tmPtr->tm_min); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5413 |
seconds = __MKSMALLINT(tmPtr->tm_sec); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5414 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5415 |
year = __MKSMALLINT(tmPtr->tm_year + 1900); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5416 |
month = __MKSMALLINT(tmPtr->tm_mon + 1); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5417 |
day = __MKSMALLINT(tmPtr->tm_mday); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5418 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5419 |
yDay = __MKSMALLINT(tmPtr->tm_yday + 1); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5420 |
wDay = __MKSMALLINT(tmPtr->tm_wday == 0 ? 7 : tmPtr->tm_wday); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5421 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5422 |
if (tmPtr->tm_isdst == 0) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5423 |
dst = false; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5424 |
utcOffset = __MKINT(TIMEZONE(tmPtr)); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5425 |
} else { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5426 |
dst = true; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5427 |
#ifdef HAS_ALTZONE |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5428 |
utcOffset = __MKINT(altzone); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5429 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5430 |
utcOffset = __MKINT(TIMEZONE(tmPtr) + 3600); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5431 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5432 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5433 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5434 |
"I would love to have SELF-like inline objects ..." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5435 |
ret := Array new:11. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5436 |
ret at:1 put:year. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5437 |
ret at:2 put:month. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5438 |
ret at:3 put:day. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5439 |
ret at:4 put:hours. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5440 |
ret at:5 put:minutes. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5441 |
ret at:6 put:seconds. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5442 |
ret at:7 put:utcOffset. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5443 |
ret at:8 put:dst. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5444 |
ret at:9 put:millis. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5445 |
ret at:10 put:yDay. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5446 |
ret at:11 put:wDay. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5447 |
^ ret |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5448 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5449 |
" |
3796 | 5450 |
OperatingSystem computeUTCTimeAndDateFrom:0 |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5451 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5452 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5453 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5454 |
computeUTCTimePartsOf:osTime for:aBlock |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5455 |
"compute hours, minutes, seconds and milliseconds from the osTime |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5456 |
and evaluate the argument, a 4-arg block with these. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5457 |
Conversion is to UTC." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5458 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5459 |
|hours minutes seconds millis osSeconds| |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5460 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5461 |
osSeconds := osTime // 1000. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5462 |
millis := osTime \\ 1000. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5463 |
%{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5464 |
struct tm *tmPtr; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5465 |
long t; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5466 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5467 |
t = __longIntVal(osSeconds); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5468 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5469 |
tmPtr = gmtime(&t); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5470 |
hours = __MKSMALLINT(tmPtr->tm_hour); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5471 |
minutes = __MKSMALLINT(tmPtr->tm_min); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5472 |
seconds = __MKSMALLINT(tmPtr->tm_sec); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5473 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5474 |
aBlock value:hours value:minutes value:seconds value:millis |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5475 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5476 |
" |
3796 | 5477 |
OperatingSystem computeUTCTimePartsOf:100 for:[:h :m :s :milli | |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5478 |
h printCR. m printCR. s printCR. milli printCR |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5479 |
] |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5480 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5481 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5482 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5483 |
getMillisecondTime |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5484 |
"This returns the millisecond timers value. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5485 |
The range is limited to 0..1fffffff (i.e. the SmallInteger range) to avoid |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5486 |
LargeInteger arithmetic when doing timeouts and delays. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5487 |
Since this value is wrapping around in regular intervals, this can only be used for |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5488 |
short relative time deltas. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5489 |
Use the millisecondTimeXXX:-methods to compare and add time deltas - these know about the wrap. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5490 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5491 |
BAD DESIGN: |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5492 |
This should be changed to return some instance of RelativeTime, |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5493 |
and these computations moved there. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5494 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5495 |
Dont use this method in application code since it is an internal (private) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5496 |
interface. For compatibility with ST-80, use Time millisecondClockValue. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5497 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5498 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5499 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5500 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5501 |
long t = 0; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5502 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5503 |
#if !defined(HAS_GETTIMEOFDAY) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5504 |
# if defined(HAS_FTIME) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5505 |
struct timeb timebuffer; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5506 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5507 |
ftime(&timebuffer); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5508 |
t = (timebuffer.time * 1000) + timebuffer.millitm; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5509 |
# define HAVE_TIME |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5510 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5511 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5512 |
# ifndef HAVE_TIME |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5513 |
# ifdef WIN32 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5514 |
t = GetTickCount(); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5515 |
# define HAVE_TIME |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5516 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5517 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5518 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5519 |
# ifndef HAVE_TIME |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5520 |
# ifdef MSDOS_LIKE |
3572 | 5521 |
# ifdef __BORLANDC__ |
5522 |
struct timeb timebuffer; |
|
5523 |
ftime(&timebuffer); |
|
5524 |
# else |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5525 |
struct _timeb timebuffer; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5526 |
_ftime(&timebuffer); |
3572 | 5527 |
# endif |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5528 |
t = (timebuffer.time * 1000) + timebuffer.millitm; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5529 |
# define HAVE_TIME |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5530 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5531 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5532 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5533 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5534 |
#ifndef HAVE_TIME |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5535 |
/* assume HAS_GETTIMEOFDAY |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5536 |
* - will result in a linkage error |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5537 |
* if not fixed. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5538 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5539 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5540 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5541 |
* bsd time |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5542 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5543 |
struct timeval tb; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5544 |
struct timezone tzb; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5545 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5546 |
gettimeofday(&tb, &tzb); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5547 |
t = tb.tv_sec*1000 + tb.tv_usec/1000; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5548 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5549 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5550 |
#undef HAVE_TIME |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5551 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5552 |
RETURN ( __MKSMALLINT(t & 0x1FFFFFFF) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5553 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5554 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5555 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5556 |
getOSTime |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5557 |
"This returns the OS time. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5558 |
The base of the returned value is not consistent across |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5559 |
different OS's - some return the number of millis since jan, 1st 1970; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5560 |
others since 1900. The Time classes are prepared for this, and |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5561 |
converts as appropriate (by using my fromOSTime: conversion methods). |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5562 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5563 |
Dont use this method in application code since it is an internal (private) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5564 |
interface. For compatibility with ST-80, use Time>>millisecondClockValue. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5565 |
or use instances of Time, Date or AbsoluteTime to work with. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5566 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5567 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5568 |
|seconds millis| |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5569 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5570 |
%{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5571 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5572 |
long t; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5573 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5574 |
#if !defined(HAS_GETTIMEOFDAY) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5575 |
# if defined(HAS_FTIME) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5576 |
struct timeb timebuffer; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5577 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5578 |
ftime(&timebuffer); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5579 |
seconds = __MKUINT(timebuffer.time); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5580 |
millis = __MKUINT(timebuffer.millitm); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5581 |
# define HAVE_TIME |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5582 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5583 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5584 |
# ifndef HAVE_TIME |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5585 |
# ifdef MSDOS_LIKE |
3572 | 5586 |
# ifdef __BORLANDC__ |
5587 |
struct timeb timebuffer; |
|
5588 |
ftime(&timebuffer); |
|
5589 |
# else |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5590 |
struct _timeb timebuffer; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5591 |
_ftime(&timebuffer); |
3572 | 5592 |
# endif |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5593 |
seconds = __MKUINT(timebuffer.time); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5594 |
millis = __MKUINT(timebuffer.millitm); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5595 |
# define HAVE_TIME |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5596 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5597 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5598 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5599 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5600 |
#ifndef HAVE_TIME |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5601 |
/* assume HAS_GETTIMEOFDAY |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5602 |
* - will result in a linkage error |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5603 |
* if not fixed. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5604 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5605 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5606 |
* bsd time |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5607 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5608 |
struct timeval tb; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5609 |
struct timezone tzb; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5610 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5611 |
gettimeofday(&tb, &tzb); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5612 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5613 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5614 |
* mhmh long-long stuff seems not to work correctly |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5615 |
* on all machines (sparc) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5616 |
* being conservative here ... |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5617 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5618 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5619 |
# if defined(__GNUC__) && (__GNUC__ >= 2) && defined(i386) && defined(LINUX) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5620 |
# define HAS_LONGLONG |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5621 |
# endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5622 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5623 |
# ifdef HAS_LONGLONG |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5624 |
{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5625 |
unsigned long long _secs, _millis, rslt; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5626 |
unsigned low, hi; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5627 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5628 |
_secs = tb.tv_sec; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5629 |
_millis = tb.tv_usec / 1000; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5630 |
rslt = _secs * 1000 + _millis; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5631 |
low = rslt & 0xFFFFFFFF; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5632 |
hi = rslt >> 32; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5633 |
RETURN (__MKLARGEINT64(1, low, hi)); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5634 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5635 |
# endif /* long long */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5636 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5637 |
# ifdef alpha64 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5638 |
{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5639 |
unsigned INT _secs, _millis, rslt; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5640 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5641 |
_secs = (INT) tb.tv_sec; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5642 |
_millis = (INT) tb.tv_usec / 1000; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5643 |
rslt = _secs * 1000 + _millis; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5644 |
RETURN (__MKUINT(rslt)); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5645 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5646 |
# endif /* alpha */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5647 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5648 |
seconds = __MKUINT(tb.tv_sec); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5649 |
millis = __MKUINT(tb.tv_usec / 1000); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5650 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5651 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5652 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5653 |
#undef HAVE_TIME |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5654 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5655 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5656 |
^ (seconds * 1000) + millis |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5657 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5658 |
" |
3796 | 5659 |
OperatingSystem getOSTime printCR. |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5660 |
Delay waitForSeconds:0.2. |
3796 | 5661 |
OperatingSystem getOSTime printCR. |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5662 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5663 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5664 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5665 |
millisecondDelay:millis |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5666 |
"delay execution for millis milliseconds or until the next event |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5667 |
arrives. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5668 |
All lower priority threads will also sleep for the duration, |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5669 |
interrupts (and therefore, higher prio processes) are |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5670 |
still handled. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5671 |
Better use a Delay, to only delay the calling thread. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5672 |
(however, a delay cannot be used in the event handler or scheduler)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5673 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5674 |
|now then delta| |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5675 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5676 |
now := Win32OperatingSystem getMillisecondTime. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5677 |
then := Win32OperatingSystem millisecondTimeAdd:now and:millis. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5678 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5679 |
[Win32OperatingSystem millisecondTime:then isAfter:now] whileTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5680 |
delta := Win32OperatingSystem millisecondTimeDeltaBetween:then and:now. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5681 |
self selectOnAnyReadable:nil writable:nil exception:nil withTimeOut:delta. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5682 |
now := Win32OperatingSystem getMillisecondTime. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5683 |
] |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5684 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5685 |
" |
3796 | 5686 |
OperatingSystem millisecondDelay:2000 |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5687 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5688 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5689 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5690 |
sleep:numberOfSeconds |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5691 |
"{ Pragma: +optSpace }" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5692 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5693 |
"cease ANY action for some time. This suspends the whole smalltalk |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5694 |
(unix-) process for some time. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5695 |
Not really useful since not even low-prio processes and interrupt |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5696 |
handling will run during the sleep. |
3796 | 5697 |
Use either OperatingSystem>>millisecondDelay: (which makes all |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5698 |
threads sleep, but handles interrupts) or use a Delay (which makes |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5699 |
only the calling thread sleep)." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5700 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5701 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5702 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5703 |
if (__isSmallInteger(numberOfSeconds)) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5704 |
sleep(__intVal(numberOfSeconds)); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5705 |
RETURN ( self ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5706 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5707 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5708 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5709 |
argument not integer |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5710 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5711 |
^ self primitiveFailed |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5712 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5713 |
" |
3796 | 5714 |
OperatingSystem sleep:2 |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5715 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5716 |
! ! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5717 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5718 |
!Win32OperatingSystem class methodsFor:'users & groups'! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5719 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5720 |
getEffectiveGroupID |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5721 |
"{ Pragma: +optSpace }" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5722 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5723 |
"return the current users (thats you) effective numeric group id. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5724 |
This is only different from getGroupID, if you have ST/X running |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5725 |
as a setuid program (of which you should think about twice)." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5726 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5727 |
^ self getGroupID |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5728 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5729 |
" |
3796 | 5730 |
OperatingSystem getEffectiveGroupID |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5731 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5732 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5733 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5734 |
getEffectiveUserID |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5735 |
"{ Pragma: +optSpace }" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5736 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5737 |
"return the current users (thats you) effective numeric user id. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5738 |
This is only different from getUserID, if you have ST/X running |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5739 |
as a setuid program (of which you should think about twice)." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5740 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5741 |
^ self getUserID |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5742 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5743 |
" |
3796 | 5744 |
OperatingSystem getEffectiveUserID |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5745 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5746 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5747 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5748 |
getFullUserNameFromID:userID |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5749 |
"{ Pragma: +optSpace }" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5750 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5751 |
"return a string with the users full name - if available. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5752 |
If not, return the login name as a fallBack." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5753 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5754 |
|info gecos| |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5755 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5756 |
info := self userInfoOf:userID. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5757 |
(info notNil |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5758 |
and:[info includesKey:#gecos]) ifTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5759 |
gecos := info at:#gecos. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5760 |
(gecos includes:$,) ifTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5761 |
^ gecos copyTo:(gecos indexOf:$,) - 1 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5762 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5763 |
^ gecos |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5764 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5765 |
^ self getUserNameFromID:userID |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5766 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5767 |
" |
3796 | 5768 |
OperatingSystem getFullUserNameFromID:0 |
5769 |
OperatingSystem getFullUserNameFromID:(OperatingSystem getUserID) |
|
5770 |
||
5771 |
OperatingSystem getUserNameFromID:(OperatingSystem getUserID) |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5772 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5773 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5774 |
"Modified: 15.7.1996 / 12:44:21 / cg" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5775 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5776 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5777 |
getGroupID |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5778 |
"{ Pragma: +optSpace }" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5779 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5780 |
"return the current users (thats you) numeric group id" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5781 |
|
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5782 |
^ 1 "just a dummy for systems which do not have groupIDs" |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5783 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5784 |
" |
3796 | 5785 |
OperatingSystem getGroupID |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5786 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5787 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5788 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5789 |
getGroupNameFromID:aNumber |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5790 |
"{ Pragma: +optSpace }" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5791 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5792 |
"return the group-name-string for a given numeric group-id" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5793 |
|
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5794 |
^ '???' "just a dummy for systems which do not have groupIDs" |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5795 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5796 |
" |
3796 | 5797 |
OperatingSystem getGroupNameFromID:0 |
5798 |
OperatingSystem getGroupNameFromID:10 |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5799 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5800 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5801 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5802 |
getHomeDirectory |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5803 |
"{ Pragma: +optSpace }" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5804 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5805 |
"return the name of the users home directory |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5806 |
(i.e. yours)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5807 |
|
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
5808 |
^ OperatingSystem getEnvironment:'HOME' |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5809 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5810 |
" |
3796 | 5811 |
OperatingSystem getHomeDirectory |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5812 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5813 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5814 |
"Modified: 24.1.1997 / 11:32:13 / cg" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5815 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5816 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5817 |
getLoginName |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5818 |
"{ Pragma: +optSpace }" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5819 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5820 |
"return a string with the users login name (thats yours)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5821 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5822 |
%{ /* NOCONTEXT */ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5823 |
static char cachedName[64]; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5824 |
static firstCall = 1; |
3741 | 5825 |
#ifndef __BORLANDC__ |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5826 |
extern char *getenv(); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5827 |
extern char *getlogin(); |
3741 | 5828 |
#endif |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5829 |
char *name = (char *)0; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5830 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5831 |
if (firstCall) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5832 |
int nameSize = sizeof(cachedName); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5833 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5834 |
if (GetUserName(cachedName, &nameSize) == TRUE) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5835 |
name = cachedName; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5836 |
firstCall = 0; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5837 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5838 |
} else { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5839 |
name = cachedName; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5840 |
} |
3810 | 5841 |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5842 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5843 |
* try a few common environment variables ... |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5844 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5845 |
if (! name || (name[0] == 0) ) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5846 |
name = getenv("LOGIN"); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5847 |
if (! name || (name[0] == 0) ) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5848 |
name = getenv("LOGNAME"); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5849 |
if (! name || (name[0] == 0) ) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5850 |
name = getenv("USER"); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5851 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5852 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5853 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5854 |
/* |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5855 |
* nope - I really font know who you are. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5856 |
*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5857 |
if (! name || (name[0] == 0) ) { |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5858 |
name = "you"; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5859 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5860 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5861 |
RETURN ( __MKSTRING(name) ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5862 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5863 |
" |
3796 | 5864 |
OperatingSystem getLoginName |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5865 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5866 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5867 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5868 |
getUserID |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5869 |
"{ Pragma: +optSpace }" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5870 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5871 |
"return the current users (thats you) numeric user id" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5872 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5873 |
^ 1 "just a dummy for systems which do not have userIDs" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5874 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5875 |
" |
3796 | 5876 |
OperatingSystem getUserID |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5877 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5878 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5879 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5880 |
getUserNameFromID:aNumber |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5881 |
"{ Pragma: +optSpace }" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5882 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5883 |
"return the user-name-string for a given numeric user-id. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5884 |
This is the login name, not the fullName." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5885 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5886 |
aNumber == self getUserID ifTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5887 |
^ self getLoginName |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5888 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5889 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5890 |
^ '? (' , aNumber printString , ')' |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5891 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5892 |
" |
3796 | 5893 |
OperatingSystem getUserNameFromID:0 |
5894 |
OperatingSystem getUserNameFromID:100 |
|
5895 |
OperatingSystem getUserNameFromID:9991 |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5896 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5897 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5898 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5899 |
userInfoOf:aNameOrID |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5900 |
"{ Pragma: +optSpace }" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5901 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5902 |
"return a dictionary filled with userinfo. The argument can be either |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5903 |
a string with the users name or its numeric id. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5904 |
Notice, that not all systems provide (all of) this info; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5905 |
DOS systems return nothing; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5906 |
non-SYSV4 systems have no age/comment. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5907 |
Portable applications may want to check the systemType and NOT depend |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5908 |
on all keys to be present in the returned dictionary. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5909 |
Another notice: on some systems (SYSV4), the gecos field includes multiple |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5910 |
entries (i.e. not just the name), separated by commas. You may want to |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5911 |
extract any substring, up to the first comma to get the real life name." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5912 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5913 |
|info name passw uid gid age comment |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5914 |
gecos dir shell| |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5915 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5916 |
info := IdentityDictionary new. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5917 |
name isNil ifTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5918 |
aNameOrID == self getUserID ifTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5919 |
name := self getLoginName |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5920 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5921 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5922 |
name notNil ifTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5923 |
info at:#name put:name. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5924 |
] ifFalse:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5925 |
info at:#name put:'unknown' |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5926 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5927 |
dir isNil ifTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5928 |
aNameOrID == self getUserID ifTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5929 |
dir := self getHomeDirectory |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5930 |
] |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5931 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5932 |
dir notNil ifTrue:[info at:#dir put:dir]. |
3563 | 5933 |
"/ uid notNil ifTrue:[info at:#uid put:uid]. |
5934 |
"/ gid notNil ifTrue:[info at:#gid put:gid]. |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5935 |
^ info |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5936 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5937 |
" |
3796 | 5938 |
OperatingSystem userInfoOf:'root' |
5939 |
OperatingSystem userInfoOf:1 |
|
5940 |
OperatingSystem userInfoOf:'claus' |
|
5941 |
OperatingSystem userInfoOf:'fooBar' |
|
5942 |
OperatingSystem userInfoOf:(OperatingSystem getUserID) |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5943 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5944 |
! ! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5945 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5946 |
!Win32OperatingSystem class methodsFor:'waiting for events'! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5947 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5948 |
blockingChildProcessWait |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5949 |
"return true, if childProcessWait: blocks, if no children are ready. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5950 |
On those systems, we must be somewhat careful when looking out for |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5951 |
a subprocesses status (to avoid blocking)." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5952 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5953 |
%{ /*NOCONTEXT*/ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5954 |
#if defined(HAS_WAITPID) || defined(HAS_WAIT3) || defined(WIN32) || defined(__VMS__) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5955 |
RETURN(false); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5956 |
#else |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5957 |
RETURN(true); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5958 |
#endif |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5959 |
%} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5960 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5961 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5962 |
childProcessWait:blocking pid:pidToWait |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5963 |
"{ Pragma: +optSpace }" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5964 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5965 |
"get status changes from child processes. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5966 |
Return an OSProcessStatus or nil, if no process has terminated. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5967 |
If blocking is true, we wait until a process changed state, |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5968 |
otherwise we return immediately. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5969 |
Note that win32 needs to know the HANDLE of the process on which |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5970 |
it waits. In case of an error, THIS ALWAYS WAITS and then times out." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5971 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5972 |
|pid status code core| |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5973 |
%{ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5974 |
DWORD endStatus; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5975 |
if (__isExternalAddress(pidToWait) ) { |
3741 | 5976 |
#ifdef PROCESS1DEBUGWIN32 |
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
5977 |
printf("childProcessWait %x b %d\n",_HANDLEVal(pidToWait),blocking==true); |
3741 | 5978 |
#endif |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5979 |
endStatus = WaitForSingleObject( _HANDLEVal(pidToWait), blocking==true ? INFINITE : 0 ); |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5980 |
if ( endStatus == WAIT_TIMEOUT ) { |
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
5981 |
if (blocking==true) |
3741 | 5982 |
status = @symbol(timeout); |
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
5983 |
else |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
5984 |
{ |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
5985 |
status = @symbol(continue); |
3741 | 5986 |
#ifdef PROCESS1DEBUGWIN32 |
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
5987 |
printf("return nil\n"); |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
5988 |
#endif |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
5989 |
RETURN(nil); |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
5990 |
} |
3741 | 5991 |
} |
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
5992 |
else |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
5993 |
{ |
3741 | 5994 |
status = @symbol(exit); |
5995 |
#ifdef PROCESS1DEBUGWIN32 |
|
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
5996 |
printf("exit\n"); |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
5997 |
#endif |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
5998 |
if (endStatus == WAIT_OBJECT_0) |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
5999 |
{ |
3741 | 6000 |
if (GetExitCodeProcess(_HANDLEVal(pidToWait),&endStatus)) |
6001 |
{ |
|
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6002 |
if (endStatus == STILL_ACTIVE) |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6003 |
RETURN(nil); |
3741 | 6004 |
#ifdef PROCESS1DEBUGWIN32 |
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6005 |
printf("exit %d\n",endStatus); |
3741 | 6006 |
#endif |
6007 |
code = __MKSMALLINT(endStatus); |
|
6008 |
} |
|
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6009 |
else |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6010 |
code = __MKSMALLINT(GetLastError()); |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6011 |
} |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6012 |
else |
3741 | 6013 |
code = __MKSMALLINT(-1); |
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6014 |
} |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6015 |
core = false; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6016 |
pid = pidToWait; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6017 |
} |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6018 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6019 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6020 |
(status isNil or:[pid isNil]) ifTrue:[ |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6021 |
^ self primitiveFailed |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6022 |
]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6023 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6024 |
"/ Transcript show:'pid: '; show:pid; show:' status: '; show:status; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6025 |
"/ show:' code: '; show:code; show:' core:'; showCR:core. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6026 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6027 |
^ OSProcessStatus pid:pid status:status code:code core:core |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6028 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6029 |
" |
3796 | 6030 |
OperatingSystem childProcessWait:false |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6031 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6032 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6033 |
"Created: 5.1.1996 / 16:39:14 / stefan" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6034 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6035 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6036 |
numAvailableForReadOn:fd |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6037 |
"return the number of bytes available for reading, without blocking." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6038 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6039 |
^ (self readCheck:fd) ifTrue:[1] ifFalse:[0] |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6040 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6041 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6042 |
readCheck:fd |
3741 | 6043 |
"return true, if data is available on a filedescriptor |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6044 |
(i.e. read is possible without blocking). |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6045 |
This depends on a working select or FIONREAD to be provided by the OS." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6046 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6047 |
^ super readCheck:fd |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6048 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6049 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6050 |
selectOnAnyReadable:readFdArray writable:writeFdArray exception:exceptFdArray withTimeOut:millis |
3741 | 6051 |
"wait for any fd in readFdArray (an Array of integers) to become ready for |
6052 |
reading, writeFdArray to become ready for writing, or exceptFdArray to |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6053 |
arrive exceptional data (i.e. out-of-band data). |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6054 |
Timeout after t milliseconds or, if the timeout time is 0, immediately.. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6055 |
Empty fd-sets will always wait. Zero time can be used to poll file- |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6056 |
descriptors (i.e. to check if I/O possible without blocking). |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6057 |
Return first ready fd if I/O ok, nil if timed-out or interrupted." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6058 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6059 |
%{ |
3741 | 6060 |
#define MAXHANDLE 128 |
3800 | 6061 |
|
3741 | 6062 |
int i; |
6063 |
INT t; |
|
6064 |
OBJ fd, retFd; |
|
6065 |
int ret; |
|
6066 |
int count; |
|
6067 |
int numHandles = 0; |
|
6068 |
DWORD res; |
|
6069 |
HANDLE hArray[MAXHANDLE]; |
|
6070 |
int retArray[MAXHANDLE]; |
|
6071 |
if (__isSmallInteger(millis)) |
|
6072 |
{ |
|
6073 |
if (__isNonNilObject(readFdArray)) |
|
6074 |
{ |
|
6075 |
if (! __isArray(readFdArray)) |
|
6076 |
{ |
|
6077 |
goto fail; |
|
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6078 |
} |
3741 | 6079 |
count = __arraySize(readFdArray); |
6080 |
||
6081 |
for (i=0; (i<count) && (numHandles < MAXHANDLE);i++) { |
|
6082 |
fd = __ArrayInstPtr(readFdArray)->a_element[i]; |
|
6083 |
if (fd != nil) |
|
6084 |
{ |
|
6085 |
if (__isExternalAddress(fd)) |
|
6086 |
{ |
|
6087 |
hArray[numHandles] = _HANDLEVal(fd); |
|
6088 |
} |
|
6089 |
else |
|
6090 |
{ |
|
6091 |
hArray[numHandles] = (HANDLE) _get_osfhandle (__intVal(fd)); |
|
6092 |
||
6093 |
if (ioctlsocket((SOCKET)hArray[numHandles],FIONREAD,&res)==0) |
|
6094 |
{ |
|
6095 |
if (res > 0) |
|
6096 |
{ |
|
3810 | 6097 |
#ifdef SELECT2DEBUGWIN32 |
3741 | 6098 |
printf("wait Handles1 l=%d return this is a Socket %x\n",res,__ArrayInstPtr(readFdArray)->a_element[i]); |
3810 | 6099 |
#endif |
3741 | 6100 |
RETURN ( __ArrayInstPtr(readFdArray)->a_element[i] ); |
6101 |
} |
|
6102 |
else |
|
6103 |
{ |
|
3810 | 6104 |
#ifdef SELECT2DEBUGWIN32 |
3741 | 6105 |
printf("readWait Handle %d this is a Socket %x\n",i,__ArrayInstPtr(readFdArray)->a_element[i]); |
3810 | 6106 |
#endif |
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6107 |
//if (!__isWinNT) |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6108 |
continue; |
3741 | 6109 |
} |
6110 |
} |
|
6111 |
else |
|
6112 |
{ |
|
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6113 |
if (PeekNamedPipe((HANDLE)hArray[numHandles],0,0,0,&res,0)) |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6114 |
{ |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6115 |
if (1/*res > 0*/) |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6116 |
{ |
3810 | 6117 |
#ifdef SELECT1DEBUGWIN32 |
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6118 |
printf("wait Handles2 l=%d return this is a Pipe %x\n",res,__ArrayInstPtr(readFdArray)->a_element[i]); |
3810 | 6119 |
#endif |
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6120 |
RETURN ( __ArrayInstPtr(readFdArray)->a_element[i] ); |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6121 |
} |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6122 |
else |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6123 |
{ |
3810 | 6124 |
#ifdef SELECT1DEBUGWIN32 |
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6125 |
printf("readWait Handle %d this is a Pipe %x\n",i,__ArrayInstPtr(readFdArray)->a_element[i]); |
3810 | 6126 |
#endif |
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6127 |
continue; |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6128 |
} |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6129 |
} |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6130 |
else |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6131 |
{ |
3810 | 6132 |
#ifdef SELECT2DEBUGWIN32 |
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6133 |
printf("readWait Handle %d this is ??? %x\n",i,__ArrayInstPtr(readFdArray)->a_element[i]); |
3810 | 6134 |
#endif |
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6135 |
errno = EBADF; \ |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6136 |
|
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6137 |
@global(LastErrorNumber) = __MKSMALLINT(errno); |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6138 |
RETURN ( nil ); |
3741 | 6139 |
|
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6140 |
//continue; |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6141 |
} |
3741 | 6142 |
} |
6143 |
} |
|
6144 |
retArray[numHandles] = i; |
|
6145 |
numHandles++; |
|
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6146 |
} |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6147 |
} |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6148 |
} |
3741 | 6149 |
if (__isNonNilObject(writeFdArray)) |
6150 |
{ |
|
6151 |
if (! __isArray(writeFdArray)) |
|
6152 |
{ |
|
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6153 |
goto fail; |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6154 |
} |
3741 | 6155 |
count = __arraySize(writeFdArray); |
6156 |
for (i=0; (i<count) && (numHandles < MAXHANDLE);i++) { |
|
6157 |
fd = __ArrayInstPtr(writeFdArray)->a_element[i]; |
|
6158 |
if (fd != nil) |
|
6159 |
{ |
|
6160 |
if (__isExternalAddress(fd)) |
|
6161 |
{ |
|
6162 |
hArray[numHandles] = _HANDLEVal(fd); |
|
6163 |
} |
|
6164 |
else |
|
6165 |
{ |
|
6166 |
hArray[numHandles] = (HANDLE) _get_osfhandle (__intVal(fd)); |
|
6167 |
} |
|
6168 |
#ifdef SELECTDEBUGWIN32 |
|
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6169 |
printf("select of writeFdArray %x\n",hArray[numHandles]); |
3741 | 6170 |
#endif |
6171 |
retArray[numHandles] = i + 10000; |
|
6172 |
numHandles++; |
|
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6173 |
} |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6174 |
} |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6175 |
} |
3741 | 6176 |
if (__isNonNilObject(exceptFdArray)) |
6177 |
{ |
|
6178 |
if (! __isArray(exceptFdArray)) |
|
6179 |
{ |
|
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6180 |
goto fail; |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6181 |
} |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6182 |
count = __arraySize(exceptFdArray); |
3741 | 6183 |
for (i=0; (i<count) && (numHandles < MAXHANDLE);i++) { |
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6184 |
fd = __ArrayInstPtr(exceptFdArray)->a_element[i]; |
3741 | 6185 |
if (fd != nil) |
6186 |
{ |
|
6187 |
if (__isExternalAddress(fd)) |
|
6188 |
{ |
|
6189 |
hArray[numHandles] = _HANDLEVal(fd); |
|
6190 |
} |
|
6191 |
else |
|
6192 |
{ |
|
6193 |
hArray[numHandles] = (HANDLE) _get_osfhandle (__intVal(fd)); |
|
6194 |
} |
|
6195 |
#ifdef SELECTDEBUGWIN32 |
|
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6196 |
printf("select of exceptFdArray %x\n",hArray[numHandles]); |
3741 | 6197 |
#endif |
6198 |
retArray[numHandles] = i + 20000; |
|
6199 |
numHandles++; |
|
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6200 |
} |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6201 |
} |
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6202 |
} |
3741 | 6203 |
} |
6204 |
t = __intVal(millis); |
|
6205 |
if (numHandles) |
|
6206 |
{ |
|
6207 |
#ifdef SELECT2DEBUGWIN32 |
|
6208 |
printf("wait Handles = %d withTimeout = %d\n",numHandles,t); |
|
6209 |
#endif |
|
6210 |
//if (t > 200) |
|
6211 |
// t = 200; |
|
6212 |
#ifdef PROCESS2DEBUGWIN32 |
|
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6213 |
printf(":"); |
3741 | 6214 |
#endif |
6215 |
res = __vmWait(numHandles,hArray,MAXHANDLE, t); |
|
6216 |
#ifdef PROCESS2DEBUGWIN32 |
|
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6217 |
printf(","); |
3741 | 6218 |
#endif |
6219 |
if (res == WAIT_FAILED) |
|
6220 |
{ |
|
6221 |
//printf("wait Handles error %d\n",GetLastError()); |
|
6222 |
if (errno == EINTR) |
|
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6223 |
{ |
3741 | 6224 |
errno = 0; |
6225 |
@global(LastErrorNumber) = nil; |
|
6226 |
} |
|
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6227 |
else |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6228 |
{ |
3741 | 6229 |
errno = EBADF; \ |
6230 |
if (@global(InfoPrinting) == true) |
|
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6231 |
{ |
3741 | 6232 |
fprintf(stderr, "OS [info]: select errno = %d\n", errno); |
6233 |
} |
|
6234 |
@global(LastErrorNumber) = __MKSMALLINT(errno); |
|
6235 |
} |
|
6236 |
RETURN ( nil ); |
|
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6237 |
} |
3741 | 6238 |
if (res == WAIT_TIMEOUT) |
6239 |
{ |
|
6240 |
//printf("wait Handles return nil\n"); |
|
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6241 |
goto polling; |
3741 | 6242 |
@global(LastErrorNumber) = nil; |
6243 |
RETURN ( nil ); |
|
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6244 |
} |
3741 | 6245 |
else |
6246 |
{ |
|
6247 |
if ((res >= 0) && (res < numHandles)) |
|
6248 |
ret = res; |
|
6249 |
else |
|
6250 |
{ |
|
6251 |
#ifdef SELECTDEBUGWIN32 |
|
6252 |
printf("wait Handles res=%d error1 %d\n",res,GetLastError()); |
|
6253 |
#endif |
|
6254 |
errno = 0; |
|
6255 |
@global(LastErrorNumber) = nil; |
|
6256 |
RETURN ( nil ); |
|
6257 |
} |
|
6258 |
if (ret < numHandles) |
|
6259 |
{ |
|
6260 |
@global(LastErrorNumber) = nil; |
|
6261 |
#ifdef SELECTDEBUGWIN32 |
|
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6262 |
if (ret) |
3741 | 6263 |
printf("wait Handles %d %d return\n",ret,retArray[ret]); |
6264 |
#endif |
|
6265 |
if (retArray[ret] < 10000) |
|
6266 |
{ |
|
6267 |
RETURN ( __ArrayInstPtr(readFdArray)->a_element[retArray[ret]] ); |
|
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6268 |
} |
3741 | 6269 |
else if (retArray[ret] < 20000) |
6270 |
{ |
|
6271 |
RETURN ( __ArrayInstPtr(writeFdArray)->a_element[retArray[ret]-10000] ); |
|
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6272 |
} |
3741 | 6273 |
else |
6274 |
{ |
|
6275 |
RETURN ( __ArrayInstPtr(exceptFdArray)->a_element[retArray[ret]-20000] ); |
|
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6276 |
} |
3741 | 6277 |
} |
6278 |
printf("wait Handles ret = %d error2 %d\n",ret,GetLastError()); |
|
6279 |
goto fail; |
|
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6280 |
} |
3741 | 6281 |
} |
6282 |
else |
|
6283 |
{ |
|
6284 |
#ifdef PROCESS2DEBUGWIN32 |
|
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6285 |
printf("."); |
3741 | 6286 |
#endif |
6287 |
res = __vmWait(0,hArray,MAXHANDLE, t); |
|
6288 |
||
6289 |
polling: |
|
6290 |
||
6291 |
#ifdef PROCESS2DEBUGWIN32 |
|
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6292 |
printf(","); |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6293 |
#endif |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6294 |
if (__isNonNilObject(readFdArray)) |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6295 |
{ |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6296 |
HANDLE h; |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6297 |
if (! __isArray(readFdArray)) |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6298 |
{ |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6299 |
goto fail; |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6300 |
} |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6301 |
count = __arraySize(readFdArray); |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6302 |
for (i=0; (i<count);i++) { |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6303 |
fd = __ArrayInstPtr(readFdArray)->a_element[i]; |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6304 |
if (fd != nil) |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6305 |
{ |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6306 |
if (__isExternalAddress(fd)) |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6307 |
{ |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6308 |
continue; |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6309 |
} |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6310 |
else |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6311 |
{ |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6312 |
h = (HANDLE) _get_osfhandle (__intVal(fd)); |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6313 |
|
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6314 |
if (ioctlsocket((SOCKET)h,FIONREAD,&res)==0) |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6315 |
{ |
3772 | 6316 |
if (1/*res > 0*/) |
3747
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6317 |
RETURN ( __ArrayInstPtr(readFdArray)->a_element[i] ); |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6318 |
} |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6319 |
else |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6320 |
{ |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6321 |
if (PeekNamedPipe((HANDLE)h,0,0,0,&res,0)) |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6322 |
{ |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6323 |
if (1/*res > 0*/) |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6324 |
{ |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6325 |
RETURN ( __ArrayInstPtr(readFdArray)->a_element[i] ); |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6326 |
} |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6327 |
else |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6328 |
{ |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6329 |
continue; |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6330 |
} |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6331 |
} |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6332 |
else |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6333 |
{ |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6334 |
if (t) |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6335 |
RETURN ( __ArrayInstPtr(readFdArray)->a_element[i] ); |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6336 |
} |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6337 |
} |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6338 |
} |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6339 |
} |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6340 |
} |
42aec126cc95
care for INVALID_HANDLE_VALUE in #infoOf:
Claus Gittinger <cg@exept.de>
parents:
3741
diff
changeset
|
6341 |
} |
3741 | 6342 |
@global(LastErrorNumber) = nil; |
3513
eb78ccc7de23
removed code which is not appropriate for that class
Claus Gittinger <cg@exept.de>
parents:
3511
diff
changeset
|
6343 |
RETURN ( nil ); |
3741 | 6344 |
} |
6345 |
||
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6346 |
fail: ; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6347 |
%}. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6348 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6349 |
timeout argument not integer, |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6350 |
or any fd-array nonNil and not an array |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6351 |
or not supported by OS |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6352 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6353 |
^ self primitiveFailed |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6354 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6355 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6356 |
setBlocking:aBoolean on:fd |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6357 |
"{ Pragma: +optSpace }" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6358 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6359 |
"set/clear the blocking attribute - if set (which is the default) |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6360 |
a read on the fileDescriptor will block until data is available. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6361 |
If cleared, a read operation will immediately return with a value of |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6362 |
nil." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6363 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6364 |
^ self primitiveFailed |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6365 |
! ! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6366 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6367 |
!Win32OperatingSystem::FileStatusInfo class methodsFor:'instance creation'! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6368 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6369 |
type:t mode:m uid:u gid:g size:s id:i accessed:aT modified:mT statusChanged:sT path:lP alternativeName:name2 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6370 |
^ self basicNew |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6371 |
type:t mode:m uid:u gid:g size:s id:i accessed:aT modified:mT statusChanged:sT path:lP alternativeName:name2 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6372 |
! ! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6373 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6374 |
!Win32OperatingSystem::FileStatusInfo methodsFor:'accessing'! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6375 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6376 |
accessed |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6377 |
"return accessed" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6378 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6379 |
^ accessed! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6380 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6381 |
alternativeName |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6382 |
"return the files other name (DOS name on windows). |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6383 |
Nil if there is no other name" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6384 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6385 |
^ alternativeName |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6386 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6387 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6388 |
fixedHeaderSize |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6389 |
"return the fixedHeaderSize (VMS only; nil everywhere else)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6390 |
|
3563 | 6391 |
^ nil |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6392 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6393 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6394 |
gid |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6395 |
"return gid" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6396 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6397 |
^ gid! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6398 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6399 |
id |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6400 |
"return id" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6401 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6402 |
^ id! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6403 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6404 |
mode |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6405 |
"return mode" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6406 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6407 |
^ mode! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6408 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6409 |
modified |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6410 |
"return modified" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6411 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6412 |
^ modified! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6413 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6414 |
path |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6415 |
"for symbolic links only: return the path where the symbolic link points to" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6416 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6417 |
^ path |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6418 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6419 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6420 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6421 |
recordAttributes |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6422 |
"return the recordAttributes (VMS only; nil everywhere else)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6423 |
|
3563 | 6424 |
^ nil |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6425 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6426 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6427 |
recordFormat |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6428 |
"return the recordFormat (VMS only; nil everywhere else)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6429 |
|
3563 | 6430 |
^ nil |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6431 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6432 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6433 |
recordFormatNumeric |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6434 |
"return the recordFormat as numeric (VMS only; nil everywhere else)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6435 |
|
3563 | 6436 |
^ nil |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6437 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6438 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6439 |
recordSize |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6440 |
"return the recordSize (VMS only; nil everywhere else)" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6441 |
|
3563 | 6442 |
^ nil |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6443 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6444 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6445 |
size |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6446 |
"return size" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6447 |
|
3563 | 6448 |
^ size |
6449 |
! |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6450 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6451 |
statusChanged |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6452 |
"return statusChanged" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6453 |
|
3563 | 6454 |
^ statusChanged |
6455 |
! |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6456 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6457 |
type |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6458 |
"return type" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6459 |
|
3563 | 6460 |
^ type |
6461 |
! |
|
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6462 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6463 |
uid |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6464 |
"return uid" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6465 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6466 |
^ uid |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6467 |
! ! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6468 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6469 |
!Win32OperatingSystem::FileStatusInfo methodsFor:'backward compatibility'! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6470 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6471 |
at:key |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6472 |
"backward compatibility access: in previous releases, IdentityDictionaries |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6473 |
were used to hold my information. Allow access via key messages. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6474 |
This method will vanish - use the proper access protocol." |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6475 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6476 |
^ self perform:key |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6477 |
! ! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6478 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6479 |
!Win32OperatingSystem::FileStatusInfo methodsFor:'private accessing'! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6480 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6481 |
type:t mode:m uid:u gid:g size:s id:i accessed:aT modified:mT statusChanged:sT path:lP alternativeName:name2 |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6482 |
type := t. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6483 |
mode := m. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6484 |
uid := u. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6485 |
gid := g. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6486 |
size := s. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6487 |
id := i. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6488 |
accessed := aT. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6489 |
modified := mT. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6490 |
statusChanged := sT. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6491 |
path := lP. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6492 |
alternativeName := name2. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6493 |
! ! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6494 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6495 |
!Win32OperatingSystem::OSProcessStatus class methodsFor:'documentation'! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6496 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6497 |
documentation |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6498 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6499 |
This is an auxillary class, that holds information about status changes of |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6500 |
operating system processes (these are no smalltalk processes!!). |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6501 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6502 |
[Instance variables:] |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6503 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6504 |
pid <Integer> OS-Process identifier |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6505 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6506 |
status <Symbol> either #exit #signal #stop #continue |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6507 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6508 |
code <Integer> either exitcode or signalnumber |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6509 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6510 |
core <Boolean> true if core has been dumped |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6511 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6512 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6513 |
[author:] |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6514 |
Stefan Vogel |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6515 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6516 |
[see also:] |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6517 |
OperatingSystem |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6518 |
" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6519 |
! ! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6520 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6521 |
!Win32OperatingSystem::OSProcessStatus class methodsFor:'instance creation'! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6522 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6523 |
pid:pid status:status code:code core:core |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6524 |
"private interface for Win32OperatingSystem" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6525 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6526 |
^ self new pid:pid status:status code:code core:core |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6527 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6528 |
"Created: 28.12.1995 / 14:16:14 / stefan" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6529 |
"Modified: 30.4.1996 / 18:25:00 / cg" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6530 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6531 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6532 |
processCreationFailure |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6533 |
"private interface for Win32OperatingSystem" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6534 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6535 |
^ self new pid:-1 status:#failure code:-1 core:false |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6536 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6537 |
"Created: 28.12.1995 / 14:35:29 / stefan" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6538 |
"Modified: 30.4.1996 / 18:25:05 / cg" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6539 |
! ! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6540 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6541 |
!Win32OperatingSystem::OSProcessStatus methodsFor:'accessing'! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6542 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6543 |
code |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6544 |
"return the exitcode / signalNumber" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6545 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6546 |
^ code |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6547 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6548 |
"Created: 28.12.1995 / 14:05:07 / stefan" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6549 |
"Modified: 30.4.1996 / 18:26:23 / cg" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6550 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6551 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6552 |
core |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6553 |
"return true if core has been dumped, false otherwise" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6554 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6555 |
^ core == true |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6556 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6557 |
"Modified: 28.12.1995 / 14:14:38 / stefan" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6558 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6559 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6560 |
pid |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6561 |
"return the pid" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6562 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6563 |
^ pid |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6564 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6565 |
"Created: 28.12.1995 / 14:05:07 / stefan" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6566 |
"Modified: 30.4.1996 / 18:26:30 / cg" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6567 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6568 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6569 |
status |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6570 |
"return status as a Symbol; |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6571 |
one of #exit #signal #stop #continue" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6572 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6573 |
^ status |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6574 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6575 |
"Created: 28.12.1995 / 14:05:07 / stefan" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6576 |
"Modified: 30.4.1996 / 18:26:54 / cg" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6577 |
! ! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6578 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6579 |
!Win32OperatingSystem::OSProcessStatus methodsFor:'initialization'! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6580 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6581 |
pid:newPid status:newStatus code:newCode core:newCore |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6582 |
pid := newPid. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6583 |
status := newStatus. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6584 |
code := newCode. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6585 |
core := newCore. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6586 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6587 |
"Created: 28.12.1995 / 14:18:22 / stefan" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6588 |
! ! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6589 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6590 |
!Win32OperatingSystem::OSProcessStatus methodsFor:'private-OS interface'! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6591 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6592 |
code:something |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6593 |
"set the exitCode" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6594 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6595 |
code := something. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6596 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6597 |
"Created: 28.12.1995 / 14:05:07 / stefan" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6598 |
"Modified: 30.4.1996 / 18:25:18 / cg" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6599 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6600 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6601 |
core:something |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6602 |
"set core" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6603 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6604 |
core := something. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6605 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6606 |
"Created: 28.12.1995 / 14:05:07 / stefan" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6607 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6608 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6609 |
pid:something |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6610 |
"set pid" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6611 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6612 |
pid := something. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6613 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6614 |
"Created: 28.12.1995 / 14:05:07 / stefan" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6615 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6616 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6617 |
status:something |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6618 |
"set status" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6619 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6620 |
status := something. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6621 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6622 |
"Created: 28.12.1995 / 14:05:07 / stefan" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6623 |
! ! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6624 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6625 |
!Win32OperatingSystem::OSProcessStatus methodsFor:'queries'! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6626 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6627 |
couldNotExecute |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6628 |
"return true when a command could not be executed" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6629 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6630 |
^ status == #exit and:[code = 127]. |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6631 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6632 |
"Created: 28.12.1995 / 15:43:17 / stefan" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6633 |
"Modified: 30.4.1996 / 18:27:03 / cg" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6634 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6635 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6636 |
stillAlive |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6637 |
"true if process is still alive" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6638 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6639 |
^ status == #stop or:[status == #continue] |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6640 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6641 |
"Created: 28.12.1995 / 14:27:26 / stefan" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6642 |
! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6643 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6644 |
success |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6645 |
"true if process terminated successfully" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6646 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6647 |
^ status == #exit and:[code = 0] |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6648 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6649 |
"Created: 28.12.1995 / 14:13:05 / stefan" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6650 |
"Modified: 28.12.1995 / 14:13:41 / stefan" |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6651 |
! ! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6652 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6653 |
!Win32OperatingSystem class methodsFor:'documentation'! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6654 |
|
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6655 |
version |
3927
028ca7c70ac9
cleaned up the executeCommand protocol.
Claus Gittinger <cg@exept.de>
parents:
3902
diff
changeset
|
6656 |
^ '$Header: /cvs/stx/stx/libbasic/Attic/Win32OS.st,v 1.35 1998-11-11 15:09:11 cg Exp $' |
3505
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6657 |
! ! |
7f920b07faf6
prepared to split OS dependencies
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6658 |
Win32OperatingSystem initialize! |