Changeset 753


Ignore:
Timestamp:
Sep 29, 2003, 11:19:59 PM (22 years ago)
Author:
bird
Message:

#679: FS preservation.

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 to 1.8
    r752 r753  
    36603660typedef QSEXLREC qsExLrec_t;
    36613661
    3662 #pragma pack(1)
    36633662typedef struct _QSSFT
    36643663{
     
    36743673  PADSHORT;
    36753674} QSSFT;
    3676 #pragma pack()
    36773675typedef QSSFT qsSft_t;
    36783676
     
    1314613144#endif /* INCL_MOU */
    1314713145
     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
    1314813165/* ------------------------------ THE END --------------------------------- */
    1314913166
    13150 #pragma pack(4)
     13167#pragma pack()
    1315113168
    1315213169#endif /* not _OS2EMX_H */
  • trunk/src/emx/src/lib/misc/mkdir.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r752 r753  
    66#include <emx/syscalls.h>
    77
    8 int _STD(mkdir) (const char *name, long mode)
     8int _STD(mkdir) (const char *name, mode_t mode)
    99{
    1010  mode = 0;                     /* Keep the compiler happy */
  • trunk/src/emx/src/lib/os2_386/dos.imp

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r752 r753  
    211211DosSysCtl                       doscalls 876 ?
    212212DosTIB                          doscalls 419 ?
     213Dos32TIB                        doscalls 419 ?
     214DOS32TIB                        doscalls 419 ?
    213215DosTestPSD                      doscalls 453 ?
    214216DosTmrQueryFreq                 doscalls 362 1
  • trunk/src/emx/src/lib/sys/__chdir.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r752 r753  
    22
    33#include "libc-alias.h"
     4#define INCL_FSMACROS
    45#include <os2emx.h>
    56#include <emx/syscalls.h>
     
    1011{
    1112  ULONG rc;
     13  FS_VAR();
    1214
     15  FS_SAVE_LOAD();
    1316  rc = DosSetCurrentDir (name);
     17  FS_RESTORE();
    1418  if (rc != 0)
    1519    {
  • trunk/src/emx/src/lib/sys/__chmod.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r752 r753  
    44#include <string.h>
    55#include <errno.h>
     6#define INCL_FSMACROS
    67#include <os2emx.h>
    78#include <emx/syscalls.h>
     
    1213  ULONG rc;
    1314  FILESTATUS3 info;
     15  FS_VAR();
    1416
    1517  if (flag < 0 || flag > 1)
     
    2426      return -1;
    2527    }
     28  FS_SAVE_LOAD();
    2629  rc = DosQueryPathInfo (name, FIL_STANDARD, &info, sizeof (info));
    2730  if (rc != 0)
    2831    {
     32      FS_RESTORE();
    2933      _sys_set_errno (rc);
    3034      return -1;
    3135    }
    3236  if (flag == 0)
    33     return info.attrFile;
     37    {
     38      FS_RESTORE();
     39      return info.attrFile;
     40    }
    3441  info.attrFile = attr;
    3542  rc = DosSetPathInfo (name, FIL_STANDARD, &info, sizeof (info), 0);
     43  FS_RESTORE();
    3644  if (rc != 0)
    3745    {
  • trunk/src/emx/src/lib/sys/__chsize.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r752 r753  
    55
    66#include "libc-alias.h"
     7#define INCL_FSMACROS
    78#include <os2emx.h>
    89#include <emx/syscalls.h>
     
    1516{
    1617    ULONG rc;
     18    FS_VAR();
    1719
     20    FS_SAVE_LOAD();
    1821#if OFF_MAX > LONG_MAX
    1922    if (__pfnDosSetFileSizeL)
     
    3134    rc = DosSetFileSize(hFile, cbFile);
    3235#endif
     36    FS_RESTORE();
    3337
    3438    if (rc)
  • trunk/src/emx/src/lib/sys/__close.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r752 r753  
    22
    33#include "libc-alias.h"
     4#define INCL_FSMACROS
    45#include <os2emx.h>
    56#include <emx/syscalls.h>
     
    910{
    1011  ULONG rc;
     12  FS_VAR()
    1113
     14  FS_SAVE_LOAD();
    1215  rc = DosClose (handle);
     16  FS_RESTORE();
    1317  if (rc == 0)
    1418    return 0;
  • trunk/src/emx/src/lib/sys/__dup.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r752 r753  
    22
    33#include "libc-alias.h"
     4#define INCL_FSMACROS
    45#include <os2emx.h>
    56#include <emx/syscalls.h>
     
    910{
    1011  ULONG rc;
    11   HFILE new;
     12  HFILE hNew;
     13  FS_VAR();
    1214
    13   new = 0xffffffff;
    14   rc = DosDupHandle (handle, &new);
     15  hNew = 0xffffffff;
     16  FS_SAVE_LOAD();
     17  rc = DosDupHandle (handle, &hNew);
     18  FS_RESTORE();
    1519  if (rc != 0)
    1620    {
     
    1822      return -1;
    1923    }
    20   return new;
     24  return hNew;
    2125}
  • trunk/src/emx/src/lib/sys/__dup2.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r752 r753  
    22
    33#include "libc-alias.h"
     4#define INCL_FSMACROS
    45#include <os2emx.h>
    56#include <emx/syscalls.h>
     
    910{
    1011  ULONG rc, state;
    11   HFILE new;
     12  HFILE hNew;
     13  FS_VAR();
    1214
    13   new = handle2;
     15  hNew = handle2;
     16  FS_SAVE_LOAD();
    1417  if (handle1 == handle2)
    1518    rc = DosQueryFHState (handle1, &state); /* Check HANDLE */
    1619  else
    17     rc = DosDupHandle (handle1, &new);
     20    rc = DosDupHandle (handle1, &hNew);
     21  FS_RESTORE();
    1822  if (rc != 0)
    1923    {
     
    2125      return -1;
    2226    }
    23   return new;
     27  return hNew;
    2428}
  • trunk/src/emx/src/lib/sys/__endthread.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r752 r753  
    33#include "libc-alias.h"
    44#define INCL_DOS
     5#define INCL_FSMACROS
    56#include <os2emx.h>
    67#include <emx/syscalls.h>
     
    1011{
    1112  thread_data *tp;
     13  FS_VAR();
    1214
    1315  if (tid < MAX_THREADS && _sys_thread_table[tid] != NULL)
    1416    {
    1517      tp = _sys_thread_table[tid];
     18      FS_SAVE_LOAD();
    1619      if (tp->fd.hdir != HDIR_CREATE)
    1720        {
     
    2023        }
    2124      DosSubFreeMem (_sys_private_heap, tp, sizeof (thread_data));
     25      FS_RESTORE();
    2226      _sys_thread_table[tid] = NULL;
    2327    }
  • trunk/src/emx/src/lib/sys/__exit.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r752 r753  
    22
    33#include "libc-alias.h"
     4#define INCL_FSMACROS
    45#include <os2emx.h>
    56
    67void __exit (int rc)
    78{
     9  FS_VAR();
     10  FS_SAVE_LOAD();
    811  while (1)
    912    DosExit (EXIT_PROCESS, rc);
  • trunk/src/emx/src/lib/sys/__fcntl.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r752 r753  
    66#include <limits.h>
    77#include <io.h>
     8#define INCL_FSMACROS
    89#include <os2emx.h>
    910#include <emx/syscalls.h>
     
    1617  ULONG rc;
    1718  ULONG state, new_state;
     19  FS_VAR();
    1820
    1921  switch (request)
     
    2224      return 0;
    2325    case F_GETFD:
     26      FS_SAVE_LOAD();
    2427      rc = DosQueryFHState (handle, &state);
     28      FS_RESTORE();
    2529      if (rc != 0)
    2630        {
     
    3034      return ((state & OPEN_FLAGS_NOINHERIT) ? 1 : 0);
    3135    case F_SETFD:
     36      FS_SAVE_LOAD();
    3237      rc = DosQueryFHState (handle, &state);
     38      FS_RESTORE();
    3339      if (rc != 0)
    3440        {
     
    4349        {
    4450          new_state &= 0x7f88;
     51          FS_SAVE_LOAD();
    4552          rc = DosSetFHState (handle, new_state);
     53          FS_RESTORE();
    4654          if (rc != 0)
    4755            {
     
    8088    int     fLarge = 0;
    8189#endif
     90    FS_VAR();
    8291
    8392    /* check input */
     
    9099
    91100    /* check hFile & get filesize. */
     101    FS_SAVE_LOAD();
    92102#if OFF_MAX > LONG_MAX
    93103    if (__pfnDosOpenL)
     
    99109#endif
    100110        rc = DosQueryFileInfo(hFile, FIL_STANDARD, &info, sizeof(info.fsts3));
     111    FS_RESTORE();
    101112    if (!rc)
    102113    {
     
    167178            aflock[fLock].lOffset = offStart;
    168179            aflock[fLock].lRange  = cbRange;
     180            FS_SAVE_LOAD();
    169181            rc = __pfnDosSetFileLocksL(hFile, &aflock[0], &aflock[1], ulTimeout, fAccess);
     182            FS_RESTORE();
    170183        }
    171184        else
     
    186199            aflock[fLock].lOffset = offStart;
    187200            aflock[fLock].lRange  = cbRange;
    188 
     201            FS_SAVE_LOAD();
    189202            rc = DosSetFileLocks(hFile, &aflock[0], &aflock[1], ulTimeout, fAccess);
     203            FS_RESTORE();
    190204        }
    191205    }
  • trunk/src/emx/src/lib/sys/__fstat.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r752 r753  
    44
    55#include "libc-alias.h"
     6#define INCL_FSMACROS
    67#include <os2emx.h>
    78#include <string.h>
     
    1617    ULONG ulType;
    1718    ULONG flFlags;
     19    FS_VAR();
    1820
    1921    /*
     
    2123     */
    2224    memset(pStat, 0, sizeof(*pStat));
     25    FS_SAVE_LOAD();
    2326    rc = DosQueryHType(hFile, &ulType, &flFlags);
    2427    if (rc)
    2528    {
     29        FS_RESTORE();
    2630        _sys_set_errno(rc);
    2731        return -1;
     
    6569        if (rc)
    6670        {
     71            FS_RESTORE();
    6772            _sys_set_errno (rc);
    6873            return -1;
     
    114119        if (rc)
    115120        {
     121            FS_RESTORE();
    116122            _sys_set_errno (rc);
    117123            return -1;
     
    133139    pStat->st_nlink = 1;
    134140    pStat->st_blksize = 4096*48;
     141    FS_RESTORE();
    135142    return 0;
    136143}
  • trunk/src/emx/src/lib/sys/__ftime.c

    • Property cvs2svn:cvs-rev changed from 1.5 to 1.6
    r752 r753  
    22
    33#include "libc-alias.h"
     4#define INCL_FSMACROS
    45#include <os2emx.h>
    56#include <sys/timeb.h>
     
    1516  DATETIME now;
    1617  struct tm tm;
     18  FS_VAR();
    1719
     20  FS_SAVE_LOAD();
    1821  DosGetDateTime (&now);
     22  FS_RESTORE();
    1923  tm.tm_sec = now.seconds;
    2024  tm.tm_min = now.minutes;
  • trunk/src/emx/src/lib/sys/__ftruncate.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r752 r753  
    55
    66#include "libc-alias.h"
     7#define INCL_FSMACROS
    78#include <os2emx.h>
    89#include <emx/syscalls.h>
     
    2021        FILESTATUS3L    fsts3L;
    2122    } info;
     23    FS_VAR();
    2224
    2325    /*
    2426     * First step, figure out the current size.
    2527     */
     28    FS_SAVE_LOAD();
    2629#if OFF_MAX > LONG_MAX
    2730    if (__pfnDosOpenL)
     
    3639        cbCur = info.fsts3.cbFile;
    3740    }
     41    FS_RESTORE();
    3842    if (rc)
    3943    {
     
    4953    if (cbCur > cbFile)
    5054    {
     55        FS_SAVE_LOAD();
    5156#if OFF_MAX > LONG_MAX
    5257        if (__pfnDosSetFileSizeL)
     
    5661            if (cbFile > __LONG_MAX)
    5762            {
     63                FS_RESTORE();
    5864                errno = EOVERFLOW;
    5965                return -1;
     
    6470        rc = DosSetFileSize(hFile, cbFile);
    6571#endif
     72        FS_RESTORE();
    6673        if (rc != 0)
    6774        {
  • trunk/src/emx/src/lib/sys/__getcwd.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r752 r753  
    22
    33#include "libc-alias.h"
     4#define INCL_FSMACROS
    45#include <os2emx.h>
    56#include <emx/syscalls.h>
     
    1011  ULONG rc;
    1112  ULONG size;
     13  FS_VAR();
    1214
    1315  if (drive != 0)
    1416    drive -= 'A' - 1;
    1517  size =512;
     18  FS_SAVE_LOAD();
    1619  rc = DosQueryCurrentDir (drive, buffer, &size);
     20  FS_RESTORE();
    1721  if (rc != 0)
    1822    {
  • trunk/src/emx/src/lib/sys/__getdrive.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r752 r753  
    22
    33#include "libc-alias.h"
     4#define INCL_FSMACROS
    45#include <os2emx.h>
    56#include <emx/syscalls.h>
     
    1011  ULONG rc;
    1112  ULONG drive, map;
     13  FS_VAR();
    1214
     15  FS_SAVE_LOAD();
    1316  rc = DosQueryCurrentDisk (&drive, &map);
     17  FS_RESTORE();
    1418  if (rc == 0)
    1519    return drive - 1 + 'A';
  • trunk/src/emx/src/lib/sys/__init.c

    • Property cvs2svn:cvs-rev changed from 1.7 to 1.8
    r752 r753  
    1212#include "libc-alias.h"
    1313#define INCL_DOS
     14#define INCL_FSMACROS
    1415#include <os2emx.h>
    1516#include <string.h>
     
    246247static void _sys_terminate (int signo)
    247248{
     249  FS_VAR();
    248250  if (signo == SIGABRT)
    249251    say ("\r\nAbnormal program termination\r\n");
     
    254256      say ("\r\n");
    255257    }
     258  FS_SAVE_LOAD();
    256259  while (1)
    257260    DosExit (EXIT_PROCESS, 3);
     
    261264static void _sys_signal_acknowledge (int signo)
    262265{
     266  FS_VAR();
     267  FS_SAVE_LOAD();
    263268  switch (signo)
    264269    {
     
    273278      break;
    274279    }
     280  FS_RESTORE();
    275281}
    276282
     
    470476{
    471477  ULONG val_ms;
    472 
     478  FS_VAR();
     479
     480  FS_SAVE_LOAD();
    473481  DosQuerySysInfo (QSV_MS_COUNT, QSV_MS_COUNT, &val_ms, sizeof (val_ms));
     482  FS_RESTORE();
    474483  *ms = val_ms;
    475484}
  • trunk/src/emx/src/lib/sys/__initthread.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r752 r753  
    44#include <errno.h>
    55#define INCL_DOS
     6#define INCL_FSMACROS
    67#include <os2emx.h>
    78#include <emx/syscalls.h>
     
    1011int __initthread (void *preg)
    1112{
     13  FS_VAR();
    1214  ((PEXCEPTIONREGISTRATIONRECORD)preg)->prev_structure = NULL;
    1315  ((PEXCEPTIONREGISTRATIONRECORD)preg)->ExceptionHandler = _sys_exception;
     16  FS_SAVE_LOAD();
    1417  DosSetExceptionHandler (preg);
     18  FS_RESTORE();
    1519  return 0;
    1620}
  • trunk/src/emx/src/lib/sys/__ioctl1.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r752 r753  
    33#include "libc-alias.h"
    44#include <errno.h>
     5#define INCL_FSMACROS
    56#include <os2emx.h>
    67#include <emx/syscalls.h>
     
    1213  ULONG rc;
    1314  ULONG htype, hflags;
     15  FS_VAR();
    1416
    1517  if (code != 0)
     
    1820      return -1;
    1921    }
     22  FS_SAVE_LOAD();
    2023  rc = DosQueryHType (handle, &htype, &hflags);
     24  FS_RESTORE();
    2125  if (rc != 0)
    2226    {
  • trunk/src/emx/src/lib/sys/__ioctl2.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r752 r753  
    66#define INCL_DOSFILEMGR
    77#define INCL_DOSERRORS
     8#define INCL_FSMACROS
    89#include <os2emx.h>
    910#include <emx/syscalls.h>
     
    2021  ULONG type, flags;
    2122  int *int_ptr;
     23  FS_VAR();
    2224
    2325  switch (__IOCLW(request))
     
    2527    case __IOCLW(FGETHTYPE):
    2628      int_ptr = (int *)arg;
     29      FS_SAVE_LOAD();
    2730      rc = DosQueryHType (handle, &type, &flags);
     31      FS_RESTORE();
    2832      if (rc != 0)
    2933        {
     
    4751          break;
    4852        case 2:                 /* Pipe */
     53          FS_SAVE_LOAD();
    4954          rc = DosQueryNPHState (handle, &flags);
     55          FS_RESTORE();
    5056          if (rc == 0 || rc == ERROR_PIPE_NOT_CONNECTED)
    5157            *int_ptr = HT_NPIPE;
  • trunk/src/emx/src/lib/sys/__lseek.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r752 r753  
    55
    66#include "libc-alias.h"
     7#define INCL_FSMACROS
    78#include <os2emx.h>
    89#include <emx/syscalls.h>
     
    1516    ULONG   rc;
    1617    off_t   cbNew;
     18    FS_VAR();
    1719
    1820    if (origin == FILE_SECTOR)
     
    2224    }
    2325
     26    FS_SAVE_LOAD();
    2427#if OFF_MAX > LONG_MAX
    2528    if (__pfnDosSetFilePtrL)
     
    3437        if (off > LONG_MAX || off < LONG_MIN)
    3538        {
     39            FS_RESTORE();
    3640            errno = EOVERFLOW;
    3741            return -1;
     
    4751    }
    4852#endif
     53    FS_RESTORE();
    4954
    5055    if (rc)
  • trunk/src/emx/src/lib/sys/__mkdir.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r752 r753  
    22
    33#include "libc-alias.h"
     4#define INCL_FSMACROS
    45#include <os2emx.h>
    56#include <emx/syscalls.h>
     
    910{
    1011  ULONG rc;
     12  FS_VAR();
    1113
     14  FS_SAVE_LOAD();
    1215  rc = DosCreateDir (name, NULL);
     16  FS_RESTORE();
    1317  if (rc != 0)
    1418    {
  • trunk/src/emx/src/lib/sys/__newthread.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r752 r753  
    44#include <errno.h>
    55#define INCL_DOS
     6#define INCL_FSMACROS
    67#include <os2emx.h>
    78#include <emx/syscalls.h>
     
    1415  ULONG rc;
    1516  void *data;
     17  FS_VAR();
    1618
    1719  if (tid >= MAX_THREADS)
     
    2123      return -1;
    2224    }
     25  FS_SAVE_LOAD();
    2326  rc = DosSubAllocMem (_sys_private_heap, &data, sizeof (thread_data));
     27  FS_RESTORE();
    2428  if (rc != 0)
    2529    {
  • trunk/src/emx/src/lib/sys/__open.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r752 r753  
    66#include "libc-alias.h"
    77#define INCL_DOSERRORS
     8#define INCL_FSMACROS
    89#include <os2emx.h>
    910#include <string.h>
     
    2223    HFILE   hFile;
    2324    int     failed_open_errno;
     25    FS_VAR();
    2426
    2527    /*
     
    8486     * Try to open the file.
    8587     */
     88    FS_SAVE_LOAD();
    8689#if OFF_MAX > LONG_MAX
    8790    if (__pfnDosOpenL)
     
    9598        if (cbInitial > LONG_MAX)
    9699        {
     100            FS_RESTORE();
    97101            errno = EOVERFLOW;
    98102            return -1;
     
    106110    }
    107111#endif
     112    FS_RESTORE();
    108113
    109114    /*
  • trunk/src/emx/src/lib/sys/__pipe.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r752 r753  
    33#include "libc-alias.h"
    44#define INCL_DOSQUEUES
     5#define INCL_FSMACROS
    56#include <os2emx.h>
    67#include <emx/syscalls.h>
     
    1011{
    1112  ULONG rc;
     13  FS_VAR();
    1214
     15  FS_SAVE_LOAD();
    1316  rc = DosCreatePipe ((PHFILE)&two_handles[0], (PHFILE)&two_handles[1],
    1417                      pipe_size);
     18  FS_RESTORE();
    1519  if (rc != 0)
    1620    {
  • trunk/src/emx/src/lib/sys/__read.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r752 r753  
    22
    33#include "libc-alias.h"
     4#define INCL_FSMACROS
    45#include <os2emx.h>
    56#include <emx/syscalls.h>
     
    1011  ULONG rc;
    1112  ULONG n;
     13  FS_VAR();
    1214
     15  FS_SAVE_LOAD();
    1316  rc = DosRead (handle, buf, nbyte, &n);
     17  FS_RESTORE();
    1418  if (rc == 0)
    1519    return n;
  • trunk/src/emx/src/lib/sys/__read_kbd.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r752 r753  
    44#define INCL_DOSFILEMGR
    55#define INCL_KBD
     6#define INCL_FSMACROS
    67#include <os2emx.h>
    78#include <emx/syscalls.h>
     
    1920  char c;
    2021  static int more = -1;
     22  FS_VAR();
    2123
    2224  if (more >= 0)
     
    2628      return ret;
    2729    }
     30  FS_SAVE_LOAD();
    2831  info_mask = 0;                /* Keep the compiler happy */
    2932  info.cb = sizeof (info);
     
    7376      KbdSetStatus (&info, 0);
    7477    }
     78
     79  FS_RESTORE();
    7580  return ret;
    7681}
  • trunk/src/emx/src/lib/sys/__rmdir.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r752 r753  
    22
    33#include "libc-alias.h"
     4#define INCL_FSMACROS
    45#include <os2emx.h>
    56#include <emx/syscalls.h>
     
    910{
    1011  ULONG rc;
     12  FS_VAR();
    1113
     14  FS_SAVE_LOAD();
    1215  rc = DosDeleteDir (name);
     16  FS_RESTORE();
    1317  if (rc != 0)
    1418    {
  • trunk/src/emx/src/lib/sys/__settime.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r752 r753  
    55#include <emx/time.h>
    66#include <emx/syscalls.h>
     7#define INCL_FSMACROS
    78#define INCL_DOS
    89#include <os2.h>
     
    4546{
    4647  DATETIME dt;
     48  FS_VAR();
    4749
    4850  /* Preserve the value of DATETIME.timezone. */
    4951
     52  FS_SAVE_LOAD();
    5053  if (DosGetDateTime (&dt))
    51     return -1;
    52  
     54    {
     55      FS_RESTORE();
     56      return -1;
     57    }
     58
    5359  unix2time (&dt, tp->tv_sec + tp->tv_usec / 1000000);
    5460
     
    5965
    6066  if (DosSetDateTime (&dt))
    61     return -1;
     67    {
     68      FS_RESTORE();
     69      return -1;
     70    }
    6271
     72  FS_RESTORE();
    6373  return 0;
    6474}
  • trunk/src/emx/src/lib/sys/__spawnve.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r752 r753  
    88#include <alloca.h>
    99#define INCL_DOSPROCESS
     10#define INCL_FSMACROS
    1011#include <os2emx.h>
    1112#include <emx/syscalls.h>
     
    4041  size_t arg_size, arg_alloc, len;
    4142  int i, quote, bs, method;
     43  FS_VAR();
    4244
    4345  arg_buf = NULL; arg_alloc = 0; arg_size = 0; arg_ptr = NULL;
     
    143145  *arg_ptr++ = '\0';
    144146  *arg_ptr++ = '\0';
     147  FS_SAVE_LOAD();
    145148  rc = DosExecPgm (obj, sizeof (obj), exec_flag, arg_buf,
    146149                   (const char *)np->env_off, &res, pgm_name);
     150  FS_RESTORE();
    147151  if (arg_buf != NULL)
    148152    _tfree (arg_buf);
     
    159163      return res.codeTerminate;
    160164    case P_OVERLAY:
     165      FS_SAVE_LOAD();
    161166      while (1)
    162167        DosExit (EXIT_PROCESS, 0);
  • trunk/src/emx/src/lib/sys/__stat.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r752 r753  
    44
    55#include "libc-alias.h"
     6#define INCL_FSMACROS
    67#include <os2emx.h>
    78#include <string.h>
     
    2324    int     fLarge = 0;
    2425#endif
     26    FS_VAR();
    2527
    2628    /*
     
    3941     * Get path info.
    4042     */
     43    FS_SAVE_LOAD();
    4144#if OFF_MAX > LONG_MAX
    4245    if (__pfnDosOpenL)
     
    4851#endif
    4952        rc = DosQueryPathInfo(pszPath, FIL_STANDARD, &info, sizeof(info.fsts3));
     53    FS_RESTORE();
    5054    if (rc)
    5155    {
     
    115119    pStat->st_rdev = 0;
    116120    pStat->st_nlink = 1;
    117     pStat->st_reserved = 0;             /* what is this good for?!? */
    118121    pStat->st_blksize = 4096*48;
    119122    return 0;
  • trunk/src/emx/src/lib/sys/__utimes.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r752 r753  
    22
    33#include "libc-alias.h"
     4#define INCL_FSMACROS
    45#include <os2emx.h>
    56#include <string.h>
     
    3637  ULONG rc;
    3738  FILESTATUS3 info;
     39  FS_VAR();
    3840
    3941  if ((name[0] == '/' || name[0] == '\\') && strlen (name) >= 6 &&
     
    4345      return -1;
    4446    }
     47  FS_SAVE_LOAD();
    4548  rc = DosQueryPathInfo (name, FIL_STANDARD, &info, sizeof (info));
    4649  if (rc != 0)
    4750    {
     51      FS_RESTORE();
    4852      _sys_set_errno (rc);
    4953      return -1;
     
    5256  _sys_t2p (tvp[1].tv_sec, &info.ftimeLastWrite, &info.fdateLastWrite);
    5357  rc = DosSetPathInfo (name, FIL_STANDARD, &info, sizeof (info), 0);
     58  FS_RESTORE();
    5459  if (rc != 0)
    5560    {
  • trunk/src/emx/src/lib/sys/__wait.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r752 r753  
    33#include "libc-alias.h"
    44#define INCL_DOSPROCESS
     5#define INCL_FSMACROS
    56#include <os2emx.h>
    67#include <emx/syscalls.h>
     
    1213  RESULTCODES res;
    1314  PID pid;
     15  FS_VAR();
    1416
     17  FS_SAVE_LOAD();
    1518  rc = DosWaitChild (DCWA_PROCESS, DCWW_WAIT, &res, &pid, 0);
     19  FS_RESTORE();
    1620  if (rc != 0)
    1721    {
  • trunk/src/emx/src/lib/sys/__waitpid.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r752 r753  
    33#include "libc-alias.h"
    44#define INCL_DOSPROCESS
     5#define INCL_FSMACROS
    56#include <os2emx.h>
    67#include <emx/syscalls.h>
     
    1213  RESULTCODES res;
    1314  PID pid2;
     15  FS_VAR();
    1416
    1517  if (pid == -1)
    1618    pid = 0;
     19  FS_SAVE_LOAD();
    1720  rc = DosWaitChild (DCWA_PROCESS, DCWW_WAIT, &res, &pid2, pid);
     21  FS_RESTORE();
    1822  if (rc != 0)
    1923    {
  • trunk/src/emx/src/lib/sys/__write.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r752 r753  
    22
    33#include "libc-alias.h"
     4#define INCL_FSMACROS
    45#include <os2emx.h>
    56#include <emx/syscalls.h>
     
    1011  ULONG rc;
    1112  ULONG n;
     13  FS_VAR();
    1214
     15  FS_SAVE_LOAD();
    1316  rc = DosWrite (handle, buf, nbyte, &n);
     17  FS_RESTORE();
    1418  if (rc == 0)
    1519    return n;
  • trunk/src/emx/src/lib/sys/chdrive.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r752 r753  
    22
    33#include "libc-alias.h"
     4#define INCL_FSMACROS
    45#include <os2emx.h>
    56#include <emx/syscalls.h>
     
    89int _STD(chdrive) (char drive)
    910{
     11  FS_VAR();
    1012  if (drive >= 'a')
    1113    drive -= 0x20;
     14  FS_SAVE_LOAD();
    1215  DosSetDefaultDisk (drive - 'A' + 1);
     16  FS_RESTORE();
    1317  return 0;
    1418}
  • trunk/src/emx/src/lib/sys/execname.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r752 r753  
    33#include "libc-alias.h"
    44#define INCL_DOS
     5#define INCL_FSMACROS
    56#include <os2emx.h>
    67#include <string.h>
     
    1314  PTIB ptib;
    1415  PPIB ppib;
     16  FS_VAR();
    1517
    1618  if (size == 0)
    1719    return -1;
    1820
     21  FS_SAVE_LOAD();
    1922  rc = DosGetInfoBlocks (&ptib, &ppib);
    2023  if (rc != 0)
    2124    {
     25      FS_RESTORE();
    2226      *dst = 0;
    2327      return -1;
     
    2529
    2630  rc = DosQueryModuleName (ppib->pib_hmte, size, dst);
     31  FS_RESTORE();
    2732  if (rc != 0)
    2833    {
  • trunk/src/emx/src/lib/sys/filefind.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r752 r753  
    88#include <limits.h>
    99#define INCL_BASE
     10#define INCL_FSMACROS
    1011#include <os2emx.h>
    1112#include <emx/syscalls.h>
     
    2021    if (pFD->hdir != HDIR_CREATE)
    2122    {
     23        FS_VAR();
     24        FS_SAVE_LOAD();
    2225        DosFindClose(pFD->hdir);
     26        FS_RESTORE();
    2327        pFD->hdir = HDIR_CREATE;
    2428    }
     
    111115    ULONG               rc;
    112116    struct find_data   *pFD = &SYS_THREAD->fd;
     117    FS_VAR();
    113118
    114119    /*
     
    121126           handling below (will DosFindFirst close the handle on error
    122127           if it is open?). */
     128        FS_SAVE_LOAD();
    123129        DosFindClose(pFD->hdir);
     130        FS_RESTORE();
    124131        pFD->hdir = HDIR_CREATE;
    125132    }
     
    134141    pFD->fType = FIL_STANDARD;
    135142#endif
     143    FS_SAVE_LOAD();
    136144    rc = DosFindFirst(pszName,
    137145                      &pFD->hdir,
     
    141149                      &pFD->cFiles,
    142150                      pFD->fType);
     151    FS_RESTORE();
    143152    if (rc)
    144153    {
     
    170179    ULONG               rc;
    171180    struct find_data   *pFD = &SYS_THREAD->fd;
     181    FS_VAR();
    172182
    173183    /*
     
    186196    {
    187197        pFD->cFiles = 30; /* !! Careful with this number! Wrong values can trigger stupid bugs. */
     198        FS_SAVE_LOAD();
    188199        rc = DosFindNext(pFD->hdir, &pFD->achBuffer[0], sizeof(pFD->achBuffer), &pFD->cFiles);
     200        FS_RESTORE();
    189201        if (rc)
    190202        {
  • trunk/src/emx/src/lib/sys/filesys.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r752 r753  
    44#include <string.h>
    55#include <errno.h>
     6#define INCL_FSMACROS
    67#include <os2emx.h>
    78#include <alloca.h>
     
    1617  ULONG len;
    1718  FSQBUFFER2 *buf;
     19  FS_VAR();
    1820
    1921  len = sizeof (FSQBUFFER2) + QFSA_SIZE;
    2022  buf = alloca (len);
     23  FS_SAVE_LOAD();
    2124  rc = DosQueryFSAttach (drive, 1, FSAIL_QUERYNAME, buf, &len);
     25  FS_RESTORE();
    2226  if (rc != 0)
    2327    {
  • trunk/src/emx/src/lib/sys/fsync.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r752 r753  
    22
    33#include "libc-alias.h"
     4#define INCL_FSMACROS
    45#include <os2emx.h>
    56#include <emx/syscalls.h>
     
    910{
    1011  ULONG rc;
     12  FS_VAR();
    1113
     14  FS_SAVE_LOAD();
    1215  rc = DosResetBuffer (handle);
     16  FS_RESTORE();
    1317  if (rc != 0)
    1418    {
  • trunk/src/emx/src/lib/sys/heap.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r752 r753  
    33#include "libc-alias.h"
    44#define INCL_DOSERRORS
     5#define INCL_FSMACROS
    56#include <os2emx.h>
    67#include <errno.h>
     
    1819  ULONG ret;
    1920  void *p;
    20 
     21  FS_VAR();
     22
     23  FS_SAVE_LOAD();
    2124  if (DosAllocMem (&p, size, PAG_READ | PAG_WRITE) != 0)
    22     return 0;
     25    {
     26      FS_RESTORE();
     27      return 0;
     28    }
    2329  if ((ULONG)p > min_addr)
    24     return (ULONG)p;
     30    {
     31      FS_RESTORE();
     32      return (ULONG)p;
     33    }
    2534
    2635  /* The memory object is located below MIN_ADDR.  Recurse until we
     
    3241
    3342  DosFreeMem (p);
     43  FS_RESTORE();
    3444  return ret;
    3545}
     
    6474  if (size != 0)
    6575    {
     76      FS_VAR();
     77      FS_SAVE_LOAD();
    6678      rc = DosSetMem ((void *)addr, size, PAG_DEFAULT | PAG_COMMIT);
     79      FS_RESTORE();
    6780      if (rc != 0)
    6881        return 0;
     
    90103  if (high > addr)
    91104    {
     105      FS_VAR();
     106      FS_SAVE_LOAD();
    92107      rc = DosSetMem ((void *)addr, high - addr, PAG_DECOMMIT);
     108      FS_RESTORE();
    93109      if (rc != 0)
    94110        return 0;
     
    137153      if (old_obj_count == 0 && sbrk_model != _UF_SBRK_CONTIGUOUS)
    138154        {
     155          FS_VAR();
     156          FS_SAVE_LOAD();
    139157          DosFreeMem ((void *)_sys_heap_objs[0].base);
     158          FS_RESTORE();
    140159          _sys_heap_obj_count = 0;
    141160          _sys_top_heap_obj = NULL;
     
    234253      while (_sys_heap_obj_count - 1 > obj)
    235254        {
     255          FS_VAR();
    236256          _sys_heap_obj_count -= 1;
     257          FS_SAVE_LOAD();
    237258          DosFreeMem ((void *)_sys_heap_objs[_sys_heap_obj_count].base);
     259          FS_RESTORE();
    238260          _sys_heap_objs[_sys_heap_obj_count].base = 0;
    239261        }
     
    268290      if (obj != 0 || (_sys_uflags & _UF_SBRK_MODEL) != _UF_SBRK_CONTIGUOUS)
    269291        {
     292          FS_VAR();
    270293          _sys_heap_obj_count -= 1;
     294          FS_SAVE_LOAD();
    271295          DosFreeMem ((void *)_sys_heap_objs[_sys_heap_obj_count].base);
     296          FS_RESTORE();
    272297          _sys_heap_objs[_sys_heap_obj_count].base = 0;
    273298
  • trunk/src/emx/src/lib/sys/kill.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r752 r753  
    33#include "libc-alias.h"
    44#define INCL_DOSEXCEPTIONS
     5#define INCL_FSMACROS
    56#include <os2emx.h>
    67#include <errno.h>
     
    1314  ULONG rc;
    1415  ULONG n;
     16  FS_VAR();
    1517
    1618  if (pid == getpid ())
     
    2628      else
    2729        n = XCPT_SIGNAL_BREAK;
     30      FS_SAVE_LOAD();
    2831      rc = DosSendSignalException (pid, n);
     32      FS_RESTORE();
    2933      if (rc != 0)
    3034        {
  • trunk/src/emx/src/lib/sys/pause.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r752 r753  
    33#include "libc-alias.h"
    44#define INCL_DOSPROCESS
     5#define INCL_FSMACROS
    56#include <os2emx.h>
    67#include <emx/syscalls.h>
     
    1011int _STD(pause) (void)
    1112{
     13  FS_VAR();
     14  FS_SAVE_LOAD();
    1215  while (DosSleep (0xffffffff) == 0)
    1316    ;
    1417  errno = EINTR;
     18  FS_RESTORE();
    1519  return -1;
    1620}
  • trunk/src/emx/src/lib/sys/remove.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r752 r753  
    22
    33#include "libc-alias.h"
     4#define INCL_FSMACROS
    45#include <os2emx.h>
    56#include <emx/syscalls.h>
     
    910{
    1011  ULONG rc;
     12  FS_VAR();
    1113
     14  FS_SAVE_LOAD();
    1215  rc = DosDelete (name);
     16  FS_RESTORE();
    1317  if (rc == 0)
    1418    return 0;
  • trunk/src/emx/src/lib/sys/rename.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r752 r753  
    22
    33#include "libc-alias.h"
     4#define INCL_FSMACROS
    45#include <os2emx.h>
    56#include <emx/syscalls.h>
     
    910{
    1011  ULONG rc;
     12  FS_VAR();
    1113
     14  FS_SAVE_LOAD();
    1215  rc = DosMove (old_name, new_name);
     16  FS_RESTORE();
    1317  if (rc != 0)
    1418    {
  • trunk/src/emx/src/lib/sys/scrsize.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r752 r753  
    33#include "libc-alias.h"
    44#define INCL_VIO
     5#define INCL_FSMACROS
    56#include <os2emx.h>
    67#include <os2thunk.h>
     
    1011{
    1112  VIOMODEINFO vmi1, vmi2, *pvmi;
     13  FS_VAR();
    1214
    1315  /* At most one of vmi1, vmi2 crosses a 64Kbyte boundary.  Use one
     
    1618  pvmi = _THUNK_PTR_STRUCT_OK (&vmi1) ? &vmi1 : &vmi2;
    1719  pvmi->cb = sizeof (*pvmi);
     20  FS_SAVE_LOAD();
    1821  VioGetMode (pvmi, 0);
     22  FS_RESTORE();
    1923  dst[0] = pvmi->col;
    2024  dst[1] = pvmi->row;
  • trunk/src/emx/src/lib/sys/sleep.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r752 r753  
    44#define INCL_DOSMISC
    55#define INCL_DOSPROCESS
     6#define INCL_FSMACROS
    67#include <os2emx.h>
    78#include <emx/syscalls.h>
     
    1011unsigned _STD(sleep) (unsigned sec)
    1112{
     13  FS_VAR();
    1214  if (sec == 0)
    1315    {
     16      FS_SAVE_LOAD();
    1417      DosSleep (0);
     18      FS_RESTORE();
    1519      return 0;
    1620    }
     
    1923      ULONG start, stop, elapsed;
    2024
     25      FS_SAVE_LOAD();
    2126      DosQuerySysInfo (QSV_TIME_LOW, QSV_TIME_LOW, &start, sizeof (start));
    2227      if (DosSleep (1000 * sec) == 0)
    23         return 0;
     28        {
     29          FS_RESTORE();
     30          return 0;
     31        }
    2432      DosQuerySysInfo (QSV_TIME_LOW, QSV_TIME_LOW, &stop, sizeof (stop));
     33      FS_RESTORE();
    2534      elapsed = stop - start;
    2635      if (sec < elapsed)
  • trunk/src/emx/src/lib/sys/sleep2.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r752 r753  
    33#include "libc-alias.h"
    44#define INCL_DOSPROCESS
     5#define INCL_FSMACROS
    56#include <os2emx.h>
    67#include <emx/syscalls.h>
     
    910unsigned _sleep2 (unsigned millisec)
    1011{
     12  FS_VAR();
     13
     14  FS_SAVE_LOAD();
    1115  DosSleep (millisec);
     16  FS_RESTORE();
    1217  return 0;
    1318}
  • trunk/src/emx/src/libos2/dos.imp

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r752 r753  
    211211DosSysCtl                       doscalls 876 ?
    212212DosTIB                          doscalls 419 ?
     213Dos32TIB                        doscalls 419 ?
     214DOS32TIB                        doscalls 419 ?
    213215DosTestPSD                      doscalls 453 ?
    214216DosTmrQueryFreq                 doscalls 362 1
Note: See TracChangeset for help on using the changeset viewer.