Welcome to mirror list, hosted at ThFree Co, Russian Federation.

unlink.c « msp430 « libgloss - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1c8c6f2335bff467d3527728558428034464f857 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <string.h>

#include "cio.h"

signed int
unlink (const char * name)
{
  unsigned len = strlen (name);

  if (len >= CIO_BUF_SIZE)
    return -1;

  __CIOBUF__.length[0] = len;
  __CIOBUF__.length[1] = len >> 8;
  __CIOBUF__.parms[0] = CIO_UNLINK;
  __CIOBUF__.parms[1] = len;
  __CIOBUF__.parms[2] = len >> 8;
  memcpy (__CIOBUF__.buf, name, len);

  _libgloss_cio_hook ();

  return __CIOBUF__.parms[0] + __CIOBUF__.parms[1] * 256;
}