Changeset 753
- Timestamp:
- Sep 29, 2003, 11:19:59 PM (22 years ago)
- Location:
- trunk/src/emx
- Files:
-
- 50 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/include/os2emx.h
-
Property cvs2svn:cvs-rev
changed from
1.7
to1.8
r752 r753 3660 3660 typedef QSEXLREC qsExLrec_t; 3661 3661 3662 #pragma pack(1)3663 3662 typedef struct _QSSFT 3664 3663 { … … 3674 3673 PADSHORT; 3675 3674 } QSSFT; 3676 #pragma pack()3677 3675 typedef QSSFT qsSft_t; 3678 3676 … … 13146 13144 #endif /* INCL_MOU */ 13147 13145 13146 13147 /* --------------------- FS Save/Load/Restore macros ---------------------- */ 13148 13149 #if defined(INCL_FSMACROS) 13150 13151 #ifndef FS_DISABLED 13152 #define FS_VAR() volatile unsigned __fs__; 13153 #define FS_SAVE() __asm__ __volatile__ ("movl %%fs, %%eax; movl %%eax,%0;" : : "m" (__fs__) : "%eax" ) 13154 #define FS_SAVE_LOAD() __asm__ __volatile__ ("movl %%fs, %%eax; movl %%eax,%0; movl $DosTIB, %%eax; movl %%eax, %%fs" : : "m" (__fs__) : "%eax" ) 13155 #define FS_RESTORE() __asm__ __volatile__ ("movl %0, %%eax; movl %%eax,%%fs;" : : "m" (__fs__) : "%eax" ) 13156 #else 13157 #define FS_VAR() 13158 #define FS_SAVE() do { } while(0) 13159 #define FS_SAVE_LOAD() do { } while(0) 13160 #define FS_RESTORE() do { } while(0) 13161 #endif 13162 13163 #endif /* INCL_FSMACROS */ 13164 13148 13165 /* ------------------------------ THE END --------------------------------- */ 13149 13166 13150 #pragma pack( 4)13167 #pragma pack() 13151 13168 13152 13169 #endif /* not _OS2EMX_H */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/misc/mkdir.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r752 r753 6 6 #include <emx/syscalls.h> 7 7 8 int _STD(mkdir) (const char *name, longmode)8 int _STD(mkdir) (const char *name, mode_t mode) 9 9 { 10 10 mode = 0; /* Keep the compiler happy */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/os2_386/dos.imp
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r752 r753 211 211 DosSysCtl doscalls 876 ? 212 212 DosTIB doscalls 419 ? 213 Dos32TIB doscalls 419 ? 214 DOS32TIB doscalls 419 ? 213 215 DosTestPSD doscalls 453 ? 214 216 DosTmrQueryFreq doscalls 362 1 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__chdir.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r752 r753 2 2 3 3 #include "libc-alias.h" 4 #define INCL_FSMACROS 4 5 #include <os2emx.h> 5 6 #include <emx/syscalls.h> … … 10 11 { 11 12 ULONG rc; 13 FS_VAR(); 12 14 15 FS_SAVE_LOAD(); 13 16 rc = DosSetCurrentDir (name); 17 FS_RESTORE(); 14 18 if (rc != 0) 15 19 { -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__chmod.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r752 r753 4 4 #include <string.h> 5 5 #include <errno.h> 6 #define INCL_FSMACROS 6 7 #include <os2emx.h> 7 8 #include <emx/syscalls.h> … … 12 13 ULONG rc; 13 14 FILESTATUS3 info; 15 FS_VAR(); 14 16 15 17 if (flag < 0 || flag > 1) … … 24 26 return -1; 25 27 } 28 FS_SAVE_LOAD(); 26 29 rc = DosQueryPathInfo (name, FIL_STANDARD, &info, sizeof (info)); 27 30 if (rc != 0) 28 31 { 32 FS_RESTORE(); 29 33 _sys_set_errno (rc); 30 34 return -1; 31 35 } 32 36 if (flag == 0) 33 return info.attrFile; 37 { 38 FS_RESTORE(); 39 return info.attrFile; 40 } 34 41 info.attrFile = attr; 35 42 rc = DosSetPathInfo (name, FIL_STANDARD, &info, sizeof (info), 0); 43 FS_RESTORE(); 36 44 if (rc != 0) 37 45 { -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__chsize.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r752 r753 5 5 6 6 #include "libc-alias.h" 7 #define INCL_FSMACROS 7 8 #include <os2emx.h> 8 9 #include <emx/syscalls.h> … … 15 16 { 16 17 ULONG rc; 18 FS_VAR(); 17 19 20 FS_SAVE_LOAD(); 18 21 #if OFF_MAX > LONG_MAX 19 22 if (__pfnDosSetFileSizeL) … … 31 34 rc = DosSetFileSize(hFile, cbFile); 32 35 #endif 36 FS_RESTORE(); 33 37 34 38 if (rc) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__close.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r752 r753 2 2 3 3 #include "libc-alias.h" 4 #define INCL_FSMACROS 4 5 #include <os2emx.h> 5 6 #include <emx/syscalls.h> … … 9 10 { 10 11 ULONG rc; 12 FS_VAR() 11 13 14 FS_SAVE_LOAD(); 12 15 rc = DosClose (handle); 16 FS_RESTORE(); 13 17 if (rc == 0) 14 18 return 0; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__dup.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r752 r753 2 2 3 3 #include "libc-alias.h" 4 #define INCL_FSMACROS 4 5 #include <os2emx.h> 5 6 #include <emx/syscalls.h> … … 9 10 { 10 11 ULONG rc; 11 HFILE new; 12 HFILE hNew; 13 FS_VAR(); 12 14 13 new = 0xffffffff; 14 rc = DosDupHandle (handle, &new); 15 hNew = 0xffffffff; 16 FS_SAVE_LOAD(); 17 rc = DosDupHandle (handle, &hNew); 18 FS_RESTORE(); 15 19 if (rc != 0) 16 20 { … … 18 22 return -1; 19 23 } 20 return new;24 return hNew; 21 25 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__dup2.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r752 r753 2 2 3 3 #include "libc-alias.h" 4 #define INCL_FSMACROS 4 5 #include <os2emx.h> 5 6 #include <emx/syscalls.h> … … 9 10 { 10 11 ULONG rc, state; 11 HFILE new; 12 HFILE hNew; 13 FS_VAR(); 12 14 13 new = handle2; 15 hNew = handle2; 16 FS_SAVE_LOAD(); 14 17 if (handle1 == handle2) 15 18 rc = DosQueryFHState (handle1, &state); /* Check HANDLE */ 16 19 else 17 rc = DosDupHandle (handle1, &new); 20 rc = DosDupHandle (handle1, &hNew); 21 FS_RESTORE(); 18 22 if (rc != 0) 19 23 { … … 21 25 return -1; 22 26 } 23 return new;27 return hNew; 24 28 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__endthread.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r752 r753 3 3 #include "libc-alias.h" 4 4 #define INCL_DOS 5 #define INCL_FSMACROS 5 6 #include <os2emx.h> 6 7 #include <emx/syscalls.h> … … 10 11 { 11 12 thread_data *tp; 13 FS_VAR(); 12 14 13 15 if (tid < MAX_THREADS && _sys_thread_table[tid] != NULL) 14 16 { 15 17 tp = _sys_thread_table[tid]; 18 FS_SAVE_LOAD(); 16 19 if (tp->fd.hdir != HDIR_CREATE) 17 20 { … … 20 23 } 21 24 DosSubFreeMem (_sys_private_heap, tp, sizeof (thread_data)); 25 FS_RESTORE(); 22 26 _sys_thread_table[tid] = NULL; 23 27 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__exit.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r752 r753 2 2 3 3 #include "libc-alias.h" 4 #define INCL_FSMACROS 4 5 #include <os2emx.h> 5 6 6 7 void __exit (int rc) 7 8 { 9 FS_VAR(); 10 FS_SAVE_LOAD(); 8 11 while (1) 9 12 DosExit (EXIT_PROCESS, rc); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__fcntl.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r752 r753 6 6 #include <limits.h> 7 7 #include <io.h> 8 #define INCL_FSMACROS 8 9 #include <os2emx.h> 9 10 #include <emx/syscalls.h> … … 16 17 ULONG rc; 17 18 ULONG state, new_state; 19 FS_VAR(); 18 20 19 21 switch (request) … … 22 24 return 0; 23 25 case F_GETFD: 26 FS_SAVE_LOAD(); 24 27 rc = DosQueryFHState (handle, &state); 28 FS_RESTORE(); 25 29 if (rc != 0) 26 30 { … … 30 34 return ((state & OPEN_FLAGS_NOINHERIT) ? 1 : 0); 31 35 case F_SETFD: 36 FS_SAVE_LOAD(); 32 37 rc = DosQueryFHState (handle, &state); 38 FS_RESTORE(); 33 39 if (rc != 0) 34 40 { … … 43 49 { 44 50 new_state &= 0x7f88; 51 FS_SAVE_LOAD(); 45 52 rc = DosSetFHState (handle, new_state); 53 FS_RESTORE(); 46 54 if (rc != 0) 47 55 { … … 80 88 int fLarge = 0; 81 89 #endif 90 FS_VAR(); 82 91 83 92 /* check input */ … … 90 99 91 100 /* check hFile & get filesize. */ 101 FS_SAVE_LOAD(); 92 102 #if OFF_MAX > LONG_MAX 93 103 if (__pfnDosOpenL) … … 99 109 #endif 100 110 rc = DosQueryFileInfo(hFile, FIL_STANDARD, &info, sizeof(info.fsts3)); 111 FS_RESTORE(); 101 112 if (!rc) 102 113 { … … 167 178 aflock[fLock].lOffset = offStart; 168 179 aflock[fLock].lRange = cbRange; 180 FS_SAVE_LOAD(); 169 181 rc = __pfnDosSetFileLocksL(hFile, &aflock[0], &aflock[1], ulTimeout, fAccess); 182 FS_RESTORE(); 170 183 } 171 184 else … … 186 199 aflock[fLock].lOffset = offStart; 187 200 aflock[fLock].lRange = cbRange; 188 201 FS_SAVE_LOAD(); 189 202 rc = DosSetFileLocks(hFile, &aflock[0], &aflock[1], ulTimeout, fAccess); 203 FS_RESTORE(); 190 204 } 191 205 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__fstat.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r752 r753 4 4 5 5 #include "libc-alias.h" 6 #define INCL_FSMACROS 6 7 #include <os2emx.h> 7 8 #include <string.h> … … 16 17 ULONG ulType; 17 18 ULONG flFlags; 19 FS_VAR(); 18 20 19 21 /* … … 21 23 */ 22 24 memset(pStat, 0, sizeof(*pStat)); 25 FS_SAVE_LOAD(); 23 26 rc = DosQueryHType(hFile, &ulType, &flFlags); 24 27 if (rc) 25 28 { 29 FS_RESTORE(); 26 30 _sys_set_errno(rc); 27 31 return -1; … … 65 69 if (rc) 66 70 { 71 FS_RESTORE(); 67 72 _sys_set_errno (rc); 68 73 return -1; … … 114 119 if (rc) 115 120 { 121 FS_RESTORE(); 116 122 _sys_set_errno (rc); 117 123 return -1; … … 133 139 pStat->st_nlink = 1; 134 140 pStat->st_blksize = 4096*48; 141 FS_RESTORE(); 135 142 return 0; 136 143 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__ftime.c
-
Property cvs2svn:cvs-rev
changed from
1.5
to1.6
r752 r753 2 2 3 3 #include "libc-alias.h" 4 #define INCL_FSMACROS 4 5 #include <os2emx.h> 5 6 #include <sys/timeb.h> … … 15 16 DATETIME now; 16 17 struct tm tm; 18 FS_VAR(); 17 19 20 FS_SAVE_LOAD(); 18 21 DosGetDateTime (&now); 22 FS_RESTORE(); 19 23 tm.tm_sec = now.seconds; 20 24 tm.tm_min = now.minutes; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__ftruncate.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r752 r753 5 5 6 6 #include "libc-alias.h" 7 #define INCL_FSMACROS 7 8 #include <os2emx.h> 8 9 #include <emx/syscalls.h> … … 20 21 FILESTATUS3L fsts3L; 21 22 } info; 23 FS_VAR(); 22 24 23 25 /* 24 26 * First step, figure out the current size. 25 27 */ 28 FS_SAVE_LOAD(); 26 29 #if OFF_MAX > LONG_MAX 27 30 if (__pfnDosOpenL) … … 36 39 cbCur = info.fsts3.cbFile; 37 40 } 41 FS_RESTORE(); 38 42 if (rc) 39 43 { … … 49 53 if (cbCur > cbFile) 50 54 { 55 FS_SAVE_LOAD(); 51 56 #if OFF_MAX > LONG_MAX 52 57 if (__pfnDosSetFileSizeL) … … 56 61 if (cbFile > __LONG_MAX) 57 62 { 63 FS_RESTORE(); 58 64 errno = EOVERFLOW; 59 65 return -1; … … 64 70 rc = DosSetFileSize(hFile, cbFile); 65 71 #endif 72 FS_RESTORE(); 66 73 if (rc != 0) 67 74 { -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__getcwd.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r752 r753 2 2 3 3 #include "libc-alias.h" 4 #define INCL_FSMACROS 4 5 #include <os2emx.h> 5 6 #include <emx/syscalls.h> … … 10 11 ULONG rc; 11 12 ULONG size; 13 FS_VAR(); 12 14 13 15 if (drive != 0) 14 16 drive -= 'A' - 1; 15 17 size =512; 18 FS_SAVE_LOAD(); 16 19 rc = DosQueryCurrentDir (drive, buffer, &size); 20 FS_RESTORE(); 17 21 if (rc != 0) 18 22 { -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__getdrive.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r752 r753 2 2 3 3 #include "libc-alias.h" 4 #define INCL_FSMACROS 4 5 #include <os2emx.h> 5 6 #include <emx/syscalls.h> … … 10 11 ULONG rc; 11 12 ULONG drive, map; 13 FS_VAR(); 12 14 15 FS_SAVE_LOAD(); 13 16 rc = DosQueryCurrentDisk (&drive, &map); 17 FS_RESTORE(); 14 18 if (rc == 0) 15 19 return drive - 1 + 'A'; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__init.c
-
Property cvs2svn:cvs-rev
changed from
1.7
to1.8
r752 r753 12 12 #include "libc-alias.h" 13 13 #define INCL_DOS 14 #define INCL_FSMACROS 14 15 #include <os2emx.h> 15 16 #include <string.h> … … 246 247 static void _sys_terminate (int signo) 247 248 { 249 FS_VAR(); 248 250 if (signo == SIGABRT) 249 251 say ("\r\nAbnormal program termination\r\n"); … … 254 256 say ("\r\n"); 255 257 } 258 FS_SAVE_LOAD(); 256 259 while (1) 257 260 DosExit (EXIT_PROCESS, 3); … … 261 264 static void _sys_signal_acknowledge (int signo) 262 265 { 266 FS_VAR(); 267 FS_SAVE_LOAD(); 263 268 switch (signo) 264 269 { … … 273 278 break; 274 279 } 280 FS_RESTORE(); 275 281 } 276 282 … … 470 476 { 471 477 ULONG val_ms; 472 478 FS_VAR(); 479 480 FS_SAVE_LOAD(); 473 481 DosQuerySysInfo (QSV_MS_COUNT, QSV_MS_COUNT, &val_ms, sizeof (val_ms)); 482 FS_RESTORE(); 474 483 *ms = val_ms; 475 484 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__initthread.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r752 r753 4 4 #include <errno.h> 5 5 #define INCL_DOS 6 #define INCL_FSMACROS 6 7 #include <os2emx.h> 7 8 #include <emx/syscalls.h> … … 10 11 int __initthread (void *preg) 11 12 { 13 FS_VAR(); 12 14 ((PEXCEPTIONREGISTRATIONRECORD)preg)->prev_structure = NULL; 13 15 ((PEXCEPTIONREGISTRATIONRECORD)preg)->ExceptionHandler = _sys_exception; 16 FS_SAVE_LOAD(); 14 17 DosSetExceptionHandler (preg); 18 FS_RESTORE(); 15 19 return 0; 16 20 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__ioctl1.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r752 r753 3 3 #include "libc-alias.h" 4 4 #include <errno.h> 5 #define INCL_FSMACROS 5 6 #include <os2emx.h> 6 7 #include <emx/syscalls.h> … … 12 13 ULONG rc; 13 14 ULONG htype, hflags; 15 FS_VAR(); 14 16 15 17 if (code != 0) … … 18 20 return -1; 19 21 } 22 FS_SAVE_LOAD(); 20 23 rc = DosQueryHType (handle, &htype, &hflags); 24 FS_RESTORE(); 21 25 if (rc != 0) 22 26 { -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__ioctl2.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r752 r753 6 6 #define INCL_DOSFILEMGR 7 7 #define INCL_DOSERRORS 8 #define INCL_FSMACROS 8 9 #include <os2emx.h> 9 10 #include <emx/syscalls.h> … … 20 21 ULONG type, flags; 21 22 int *int_ptr; 23 FS_VAR(); 22 24 23 25 switch (__IOCLW(request)) … … 25 27 case __IOCLW(FGETHTYPE): 26 28 int_ptr = (int *)arg; 29 FS_SAVE_LOAD(); 27 30 rc = DosQueryHType (handle, &type, &flags); 31 FS_RESTORE(); 28 32 if (rc != 0) 29 33 { … … 47 51 break; 48 52 case 2: /* Pipe */ 53 FS_SAVE_LOAD(); 49 54 rc = DosQueryNPHState (handle, &flags); 55 FS_RESTORE(); 50 56 if (rc == 0 || rc == ERROR_PIPE_NOT_CONNECTED) 51 57 *int_ptr = HT_NPIPE; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__lseek.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r752 r753 5 5 6 6 #include "libc-alias.h" 7 #define INCL_FSMACROS 7 8 #include <os2emx.h> 8 9 #include <emx/syscalls.h> … … 15 16 ULONG rc; 16 17 off_t cbNew; 18 FS_VAR(); 17 19 18 20 if (origin == FILE_SECTOR) … … 22 24 } 23 25 26 FS_SAVE_LOAD(); 24 27 #if OFF_MAX > LONG_MAX 25 28 if (__pfnDosSetFilePtrL) … … 34 37 if (off > LONG_MAX || off < LONG_MIN) 35 38 { 39 FS_RESTORE(); 36 40 errno = EOVERFLOW; 37 41 return -1; … … 47 51 } 48 52 #endif 53 FS_RESTORE(); 49 54 50 55 if (rc) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__mkdir.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r752 r753 2 2 3 3 #include "libc-alias.h" 4 #define INCL_FSMACROS 4 5 #include <os2emx.h> 5 6 #include <emx/syscalls.h> … … 9 10 { 10 11 ULONG rc; 12 FS_VAR(); 11 13 14 FS_SAVE_LOAD(); 12 15 rc = DosCreateDir (name, NULL); 16 FS_RESTORE(); 13 17 if (rc != 0) 14 18 { -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__newthread.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r752 r753 4 4 #include <errno.h> 5 5 #define INCL_DOS 6 #define INCL_FSMACROS 6 7 #include <os2emx.h> 7 8 #include <emx/syscalls.h> … … 14 15 ULONG rc; 15 16 void *data; 17 FS_VAR(); 16 18 17 19 if (tid >= MAX_THREADS) … … 21 23 return -1; 22 24 } 25 FS_SAVE_LOAD(); 23 26 rc = DosSubAllocMem (_sys_private_heap, &data, sizeof (thread_data)); 27 FS_RESTORE(); 24 28 if (rc != 0) 25 29 { -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__open.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r752 r753 6 6 #include "libc-alias.h" 7 7 #define INCL_DOSERRORS 8 #define INCL_FSMACROS 8 9 #include <os2emx.h> 9 10 #include <string.h> … … 22 23 HFILE hFile; 23 24 int failed_open_errno; 25 FS_VAR(); 24 26 25 27 /* … … 84 86 * Try to open the file. 85 87 */ 88 FS_SAVE_LOAD(); 86 89 #if OFF_MAX > LONG_MAX 87 90 if (__pfnDosOpenL) … … 95 98 if (cbInitial > LONG_MAX) 96 99 { 100 FS_RESTORE(); 97 101 errno = EOVERFLOW; 98 102 return -1; … … 106 110 } 107 111 #endif 112 FS_RESTORE(); 108 113 109 114 /* -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__pipe.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r752 r753 3 3 #include "libc-alias.h" 4 4 #define INCL_DOSQUEUES 5 #define INCL_FSMACROS 5 6 #include <os2emx.h> 6 7 #include <emx/syscalls.h> … … 10 11 { 11 12 ULONG rc; 13 FS_VAR(); 12 14 15 FS_SAVE_LOAD(); 13 16 rc = DosCreatePipe ((PHFILE)&two_handles[0], (PHFILE)&two_handles[1], 14 17 pipe_size); 18 FS_RESTORE(); 15 19 if (rc != 0) 16 20 { -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__read.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r752 r753 2 2 3 3 #include "libc-alias.h" 4 #define INCL_FSMACROS 4 5 #include <os2emx.h> 5 6 #include <emx/syscalls.h> … … 10 11 ULONG rc; 11 12 ULONG n; 13 FS_VAR(); 12 14 15 FS_SAVE_LOAD(); 13 16 rc = DosRead (handle, buf, nbyte, &n); 17 FS_RESTORE(); 14 18 if (rc == 0) 15 19 return n; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__read_kbd.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r752 r753 4 4 #define INCL_DOSFILEMGR 5 5 #define INCL_KBD 6 #define INCL_FSMACROS 6 7 #include <os2emx.h> 7 8 #include <emx/syscalls.h> … … 19 20 char c; 20 21 static int more = -1; 22 FS_VAR(); 21 23 22 24 if (more >= 0) … … 26 28 return ret; 27 29 } 30 FS_SAVE_LOAD(); 28 31 info_mask = 0; /* Keep the compiler happy */ 29 32 info.cb = sizeof (info); … … 73 76 KbdSetStatus (&info, 0); 74 77 } 78 79 FS_RESTORE(); 75 80 return ret; 76 81 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__rmdir.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r752 r753 2 2 3 3 #include "libc-alias.h" 4 #define INCL_FSMACROS 4 5 #include <os2emx.h> 5 6 #include <emx/syscalls.h> … … 9 10 { 10 11 ULONG rc; 12 FS_VAR(); 11 13 14 FS_SAVE_LOAD(); 12 15 rc = DosDeleteDir (name); 16 FS_RESTORE(); 13 17 if (rc != 0) 14 18 { -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__settime.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r752 r753 5 5 #include <emx/time.h> 6 6 #include <emx/syscalls.h> 7 #define INCL_FSMACROS 7 8 #define INCL_DOS 8 9 #include <os2.h> … … 45 46 { 46 47 DATETIME dt; 48 FS_VAR(); 47 49 48 50 /* Preserve the value of DATETIME.timezone. */ 49 51 52 FS_SAVE_LOAD(); 50 53 if (DosGetDateTime (&dt)) 51 return -1; 52 54 { 55 FS_RESTORE(); 56 return -1; 57 } 58 53 59 unix2time (&dt, tp->tv_sec + tp->tv_usec / 1000000); 54 60 … … 59 65 60 66 if (DosSetDateTime (&dt)) 61 return -1; 67 { 68 FS_RESTORE(); 69 return -1; 70 } 62 71 72 FS_RESTORE(); 63 73 return 0; 64 74 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__spawnve.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r752 r753 8 8 #include <alloca.h> 9 9 #define INCL_DOSPROCESS 10 #define INCL_FSMACROS 10 11 #include <os2emx.h> 11 12 #include <emx/syscalls.h> … … 40 41 size_t arg_size, arg_alloc, len; 41 42 int i, quote, bs, method; 43 FS_VAR(); 42 44 43 45 arg_buf = NULL; arg_alloc = 0; arg_size = 0; arg_ptr = NULL; … … 143 145 *arg_ptr++ = '\0'; 144 146 *arg_ptr++ = '\0'; 147 FS_SAVE_LOAD(); 145 148 rc = DosExecPgm (obj, sizeof (obj), exec_flag, arg_buf, 146 149 (const char *)np->env_off, &res, pgm_name); 150 FS_RESTORE(); 147 151 if (arg_buf != NULL) 148 152 _tfree (arg_buf); … … 159 163 return res.codeTerminate; 160 164 case P_OVERLAY: 165 FS_SAVE_LOAD(); 161 166 while (1) 162 167 DosExit (EXIT_PROCESS, 0); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__stat.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r752 r753 4 4 5 5 #include "libc-alias.h" 6 #define INCL_FSMACROS 6 7 #include <os2emx.h> 7 8 #include <string.h> … … 23 24 int fLarge = 0; 24 25 #endif 26 FS_VAR(); 25 27 26 28 /* … … 39 41 * Get path info. 40 42 */ 43 FS_SAVE_LOAD(); 41 44 #if OFF_MAX > LONG_MAX 42 45 if (__pfnDosOpenL) … … 48 51 #endif 49 52 rc = DosQueryPathInfo(pszPath, FIL_STANDARD, &info, sizeof(info.fsts3)); 53 FS_RESTORE(); 50 54 if (rc) 51 55 { … … 115 119 pStat->st_rdev = 0; 116 120 pStat->st_nlink = 1; 117 pStat->st_reserved = 0; /* what is this good for?!? */118 121 pStat->st_blksize = 4096*48; 119 122 return 0; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__utimes.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r752 r753 2 2 3 3 #include "libc-alias.h" 4 #define INCL_FSMACROS 4 5 #include <os2emx.h> 5 6 #include <string.h> … … 36 37 ULONG rc; 37 38 FILESTATUS3 info; 39 FS_VAR(); 38 40 39 41 if ((name[0] == '/' || name[0] == '\\') && strlen (name) >= 6 && … … 43 45 return -1; 44 46 } 47 FS_SAVE_LOAD(); 45 48 rc = DosQueryPathInfo (name, FIL_STANDARD, &info, sizeof (info)); 46 49 if (rc != 0) 47 50 { 51 FS_RESTORE(); 48 52 _sys_set_errno (rc); 49 53 return -1; … … 52 56 _sys_t2p (tvp[1].tv_sec, &info.ftimeLastWrite, &info.fdateLastWrite); 53 57 rc = DosSetPathInfo (name, FIL_STANDARD, &info, sizeof (info), 0); 58 FS_RESTORE(); 54 59 if (rc != 0) 55 60 { -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__wait.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r752 r753 3 3 #include "libc-alias.h" 4 4 #define INCL_DOSPROCESS 5 #define INCL_FSMACROS 5 6 #include <os2emx.h> 6 7 #include <emx/syscalls.h> … … 12 13 RESULTCODES res; 13 14 PID pid; 15 FS_VAR(); 14 16 17 FS_SAVE_LOAD(); 15 18 rc = DosWaitChild (DCWA_PROCESS, DCWW_WAIT, &res, &pid, 0); 19 FS_RESTORE(); 16 20 if (rc != 0) 17 21 { -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__waitpid.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r752 r753 3 3 #include "libc-alias.h" 4 4 #define INCL_DOSPROCESS 5 #define INCL_FSMACROS 5 6 #include <os2emx.h> 6 7 #include <emx/syscalls.h> … … 12 13 RESULTCODES res; 13 14 PID pid2; 15 FS_VAR(); 14 16 15 17 if (pid == -1) 16 18 pid = 0; 19 FS_SAVE_LOAD(); 17 20 rc = DosWaitChild (DCWA_PROCESS, DCWW_WAIT, &res, &pid2, pid); 21 FS_RESTORE(); 18 22 if (rc != 0) 19 23 { -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__write.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r752 r753 2 2 3 3 #include "libc-alias.h" 4 #define INCL_FSMACROS 4 5 #include <os2emx.h> 5 6 #include <emx/syscalls.h> … … 10 11 ULONG rc; 11 12 ULONG n; 13 FS_VAR(); 12 14 15 FS_SAVE_LOAD(); 13 16 rc = DosWrite (handle, buf, nbyte, &n); 17 FS_RESTORE(); 14 18 if (rc == 0) 15 19 return n; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/chdrive.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r752 r753 2 2 3 3 #include "libc-alias.h" 4 #define INCL_FSMACROS 4 5 #include <os2emx.h> 5 6 #include <emx/syscalls.h> … … 8 9 int _STD(chdrive) (char drive) 9 10 { 11 FS_VAR(); 10 12 if (drive >= 'a') 11 13 drive -= 0x20; 14 FS_SAVE_LOAD(); 12 15 DosSetDefaultDisk (drive - 'A' + 1); 16 FS_RESTORE(); 13 17 return 0; 14 18 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/execname.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r752 r753 3 3 #include "libc-alias.h" 4 4 #define INCL_DOS 5 #define INCL_FSMACROS 5 6 #include <os2emx.h> 6 7 #include <string.h> … … 13 14 PTIB ptib; 14 15 PPIB ppib; 16 FS_VAR(); 15 17 16 18 if (size == 0) 17 19 return -1; 18 20 21 FS_SAVE_LOAD(); 19 22 rc = DosGetInfoBlocks (&ptib, &ppib); 20 23 if (rc != 0) 21 24 { 25 FS_RESTORE(); 22 26 *dst = 0; 23 27 return -1; … … 25 29 26 30 rc = DosQueryModuleName (ppib->pib_hmte, size, dst); 31 FS_RESTORE(); 27 32 if (rc != 0) 28 33 { -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/filefind.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r752 r753 8 8 #include <limits.h> 9 9 #define INCL_BASE 10 #define INCL_FSMACROS 10 11 #include <os2emx.h> 11 12 #include <emx/syscalls.h> … … 20 21 if (pFD->hdir != HDIR_CREATE) 21 22 { 23 FS_VAR(); 24 FS_SAVE_LOAD(); 22 25 DosFindClose(pFD->hdir); 26 FS_RESTORE(); 23 27 pFD->hdir = HDIR_CREATE; 24 28 } … … 111 115 ULONG rc; 112 116 struct find_data *pFD = &SYS_THREAD->fd; 117 FS_VAR(); 113 118 114 119 /* … … 121 126 handling below (will DosFindFirst close the handle on error 122 127 if it is open?). */ 128 FS_SAVE_LOAD(); 123 129 DosFindClose(pFD->hdir); 130 FS_RESTORE(); 124 131 pFD->hdir = HDIR_CREATE; 125 132 } … … 134 141 pFD->fType = FIL_STANDARD; 135 142 #endif 143 FS_SAVE_LOAD(); 136 144 rc = DosFindFirst(pszName, 137 145 &pFD->hdir, … … 141 149 &pFD->cFiles, 142 150 pFD->fType); 151 FS_RESTORE(); 143 152 if (rc) 144 153 { … … 170 179 ULONG rc; 171 180 struct find_data *pFD = &SYS_THREAD->fd; 181 FS_VAR(); 172 182 173 183 /* … … 186 196 { 187 197 pFD->cFiles = 30; /* !! Careful with this number! Wrong values can trigger stupid bugs. */ 198 FS_SAVE_LOAD(); 188 199 rc = DosFindNext(pFD->hdir, &pFD->achBuffer[0], sizeof(pFD->achBuffer), &pFD->cFiles); 200 FS_RESTORE(); 189 201 if (rc) 190 202 { -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/filesys.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r752 r753 4 4 #include <string.h> 5 5 #include <errno.h> 6 #define INCL_FSMACROS 6 7 #include <os2emx.h> 7 8 #include <alloca.h> … … 16 17 ULONG len; 17 18 FSQBUFFER2 *buf; 19 FS_VAR(); 18 20 19 21 len = sizeof (FSQBUFFER2) + QFSA_SIZE; 20 22 buf = alloca (len); 23 FS_SAVE_LOAD(); 21 24 rc = DosQueryFSAttach (drive, 1, FSAIL_QUERYNAME, buf, &len); 25 FS_RESTORE(); 22 26 if (rc != 0) 23 27 { -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/fsync.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r752 r753 2 2 3 3 #include "libc-alias.h" 4 #define INCL_FSMACROS 4 5 #include <os2emx.h> 5 6 #include <emx/syscalls.h> … … 9 10 { 10 11 ULONG rc; 12 FS_VAR(); 11 13 14 FS_SAVE_LOAD(); 12 15 rc = DosResetBuffer (handle); 16 FS_RESTORE(); 13 17 if (rc != 0) 14 18 { -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/heap.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r752 r753 3 3 #include "libc-alias.h" 4 4 #define INCL_DOSERRORS 5 #define INCL_FSMACROS 5 6 #include <os2emx.h> 6 7 #include <errno.h> … … 18 19 ULONG ret; 19 20 void *p; 20 21 FS_VAR(); 22 23 FS_SAVE_LOAD(); 21 24 if (DosAllocMem (&p, size, PAG_READ | PAG_WRITE) != 0) 22 return 0; 25 { 26 FS_RESTORE(); 27 return 0; 28 } 23 29 if ((ULONG)p > min_addr) 24 return (ULONG)p; 30 { 31 FS_RESTORE(); 32 return (ULONG)p; 33 } 25 34 26 35 /* The memory object is located below MIN_ADDR. Recurse until we … … 32 41 33 42 DosFreeMem (p); 43 FS_RESTORE(); 34 44 return ret; 35 45 } … … 64 74 if (size != 0) 65 75 { 76 FS_VAR(); 77 FS_SAVE_LOAD(); 66 78 rc = DosSetMem ((void *)addr, size, PAG_DEFAULT | PAG_COMMIT); 79 FS_RESTORE(); 67 80 if (rc != 0) 68 81 return 0; … … 90 103 if (high > addr) 91 104 { 105 FS_VAR(); 106 FS_SAVE_LOAD(); 92 107 rc = DosSetMem ((void *)addr, high - addr, PAG_DECOMMIT); 108 FS_RESTORE(); 93 109 if (rc != 0) 94 110 return 0; … … 137 153 if (old_obj_count == 0 && sbrk_model != _UF_SBRK_CONTIGUOUS) 138 154 { 155 FS_VAR(); 156 FS_SAVE_LOAD(); 139 157 DosFreeMem ((void *)_sys_heap_objs[0].base); 158 FS_RESTORE(); 140 159 _sys_heap_obj_count = 0; 141 160 _sys_top_heap_obj = NULL; … … 234 253 while (_sys_heap_obj_count - 1 > obj) 235 254 { 255 FS_VAR(); 236 256 _sys_heap_obj_count -= 1; 257 FS_SAVE_LOAD(); 237 258 DosFreeMem ((void *)_sys_heap_objs[_sys_heap_obj_count].base); 259 FS_RESTORE(); 238 260 _sys_heap_objs[_sys_heap_obj_count].base = 0; 239 261 } … … 268 290 if (obj != 0 || (_sys_uflags & _UF_SBRK_MODEL) != _UF_SBRK_CONTIGUOUS) 269 291 { 292 FS_VAR(); 270 293 _sys_heap_obj_count -= 1; 294 FS_SAVE_LOAD(); 271 295 DosFreeMem ((void *)_sys_heap_objs[_sys_heap_obj_count].base); 296 FS_RESTORE(); 272 297 _sys_heap_objs[_sys_heap_obj_count].base = 0; 273 298 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/kill.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r752 r753 3 3 #include "libc-alias.h" 4 4 #define INCL_DOSEXCEPTIONS 5 #define INCL_FSMACROS 5 6 #include <os2emx.h> 6 7 #include <errno.h> … … 13 14 ULONG rc; 14 15 ULONG n; 16 FS_VAR(); 15 17 16 18 if (pid == getpid ()) … … 26 28 else 27 29 n = XCPT_SIGNAL_BREAK; 30 FS_SAVE_LOAD(); 28 31 rc = DosSendSignalException (pid, n); 32 FS_RESTORE(); 29 33 if (rc != 0) 30 34 { -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/pause.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r752 r753 3 3 #include "libc-alias.h" 4 4 #define INCL_DOSPROCESS 5 #define INCL_FSMACROS 5 6 #include <os2emx.h> 6 7 #include <emx/syscalls.h> … … 10 11 int _STD(pause) (void) 11 12 { 13 FS_VAR(); 14 FS_SAVE_LOAD(); 12 15 while (DosSleep (0xffffffff) == 0) 13 16 ; 14 17 errno = EINTR; 18 FS_RESTORE(); 15 19 return -1; 16 20 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/remove.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r752 r753 2 2 3 3 #include "libc-alias.h" 4 #define INCL_FSMACROS 4 5 #include <os2emx.h> 5 6 #include <emx/syscalls.h> … … 9 10 { 10 11 ULONG rc; 12 FS_VAR(); 11 13 14 FS_SAVE_LOAD(); 12 15 rc = DosDelete (name); 16 FS_RESTORE(); 13 17 if (rc == 0) 14 18 return 0; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/rename.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r752 r753 2 2 3 3 #include "libc-alias.h" 4 #define INCL_FSMACROS 4 5 #include <os2emx.h> 5 6 #include <emx/syscalls.h> … … 9 10 { 10 11 ULONG rc; 12 FS_VAR(); 11 13 14 FS_SAVE_LOAD(); 12 15 rc = DosMove (old_name, new_name); 16 FS_RESTORE(); 13 17 if (rc != 0) 14 18 { -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/scrsize.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r752 r753 3 3 #include "libc-alias.h" 4 4 #define INCL_VIO 5 #define INCL_FSMACROS 5 6 #include <os2emx.h> 6 7 #include <os2thunk.h> … … 10 11 { 11 12 VIOMODEINFO vmi1, vmi2, *pvmi; 13 FS_VAR(); 12 14 13 15 /* At most one of vmi1, vmi2 crosses a 64Kbyte boundary. Use one … … 16 18 pvmi = _THUNK_PTR_STRUCT_OK (&vmi1) ? &vmi1 : &vmi2; 17 19 pvmi->cb = sizeof (*pvmi); 20 FS_SAVE_LOAD(); 18 21 VioGetMode (pvmi, 0); 22 FS_RESTORE(); 19 23 dst[0] = pvmi->col; 20 24 dst[1] = pvmi->row; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/sleep.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r752 r753 4 4 #define INCL_DOSMISC 5 5 #define INCL_DOSPROCESS 6 #define INCL_FSMACROS 6 7 #include <os2emx.h> 7 8 #include <emx/syscalls.h> … … 10 11 unsigned _STD(sleep) (unsigned sec) 11 12 { 13 FS_VAR(); 12 14 if (sec == 0) 13 15 { 16 FS_SAVE_LOAD(); 14 17 DosSleep (0); 18 FS_RESTORE(); 15 19 return 0; 16 20 } … … 19 23 ULONG start, stop, elapsed; 20 24 25 FS_SAVE_LOAD(); 21 26 DosQuerySysInfo (QSV_TIME_LOW, QSV_TIME_LOW, &start, sizeof (start)); 22 27 if (DosSleep (1000 * sec) == 0) 23 return 0; 28 { 29 FS_RESTORE(); 30 return 0; 31 } 24 32 DosQuerySysInfo (QSV_TIME_LOW, QSV_TIME_LOW, &stop, sizeof (stop)); 33 FS_RESTORE(); 25 34 elapsed = stop - start; 26 35 if (sec < elapsed) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/sleep2.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r752 r753 3 3 #include "libc-alias.h" 4 4 #define INCL_DOSPROCESS 5 #define INCL_FSMACROS 5 6 #include <os2emx.h> 6 7 #include <emx/syscalls.h> … … 9 10 unsigned _sleep2 (unsigned millisec) 10 11 { 12 FS_VAR(); 13 14 FS_SAVE_LOAD(); 11 15 DosSleep (millisec); 16 FS_RESTORE(); 12 17 return 0; 13 18 } -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/libos2/dos.imp
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r752 r753 211 211 DosSysCtl doscalls 876 ? 212 212 DosTIB doscalls 419 ? 213 Dos32TIB doscalls 419 ? 214 DOS32TIB doscalls 419 ? 213 215 DosTestPSD doscalls 453 ? 214 216 DosTmrQueryFreq doscalls 362 1 -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.