[DOC PATCH] Re: [BUG] sort pragma not working ?
[p5sagit/p5-mst-13.2.git] / vos / vos.c
CommitLineData
7b2b351e 1/* Beginning of modification history */
2/* Written 02-01-02 by Nick Ing-Simmons (nick@ing-simmons.net) */
a5f25d7a 3/* Modified 02-03-27 by Paul Green (Paul.Green@stratus.com) to
4 add socketpair() dummy. */
7b2b351e 5/* End of modification history */
6
a5f25d7a 7#include <errno.h>
7b2b351e 8#include <fcntl.h>
9#include <sys/types.h>
10#include <unistd.h>
11
a5f25d7a 12/* VOS doesn't supply a truncate function, so we build one up
13 from the available POSIX functions. */
14
7b2b351e 15int
16truncate(const char *path, off_t len)
17{
18 int fd = open(path,O_WRONLY);
19 int code = -1;
20 if (fd >= 0) {
21 code = ftruncate(fd,len);
22 close(fd);
23 }
24 return code;
25}
a5f25d7a 26
27/* VOS doesn't implement AF_UNIX (AF_LOCAL) style sockets, and
28 the perl emulation of them hangs on VOS (due to stcp-1257),
29 so we supply this version that always fails. */
30
31int
32socketpair (int family, int type, int protocol, int fd[2]) {
33 fd[0] = 0;
34 fd[1] = 0;
35 errno = ENOSYS;
36 return -1;
37}