/*
**    Name: csaccess.c
**
**    Date: Sun Jan  2 09:51:34 2005
**
**    Purpose:
**
*/

#include "csfcntl.h"
#include "osfile.h"
#include "kernel.h"

int csaccess(const char *pathname,int mode)
    {
    _kernel_swi_regs regs;

    if (mode == 0)
        {
        regs.r[0] = OSFile_ReadStampedNoPath;
        regs.r[1] = (int)pathname;

        if (_kernel_swi(XOS_File,&regs,&regs) != NULL) {
          return 1;
          }

        if (regs.r[0] == osfile_NOT_FOUND) {
          return 1;
          }
        }

    return 0;
    }
