Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  2. /*
  3.  * D_CREAT.C.
  4.  *
  5.  * Written by Peter Sulyok 1995 <sulyok@math.klte.hu>.
  6.  *
  7.  * This file is distributed WITHOUT ANY WARRANTY; without even the implied
  8.  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9.  *
  10.  */
  11.  
  12. #include <libc/dosio.h>
  13. #include <errno.h>
  14. #include <dos.h>
  15. #include <unistd.h>
  16. #include <fcntl.h>
  17.  
  18. static char buf[1];
  19.  
  20. unsigned int _dos_creat(const char *filename, unsigned int attr, int *handle)
  21. {
  22.  int i;
  23.  i=dosemu_open(filename,attr|O_CREAT);
  24.  if(i==-1) return -1;
  25.  if(handle) *handle=i;
  26.  return 0;
  27. }
  28.