]> icculus.org git repositories - taylor/freespace2.git/blob - src/platform/unix.cpp
merge in updated platform code
[taylor/freespace2.git] / src / platform / unix.cpp
1 /*
2  * Copyright (C) Volition, Inc. 1999.  All rights reserved.
3  *
4  * All source code herein is the property of Volition, Inc. You may not sell
5  * or otherwise commercially exploit the source or things you created based on
6  * the source.
7  */
8
9 #ifdef PLAT_UNIX
10
11 #include <stdlib.h>
12 #include <errno.h>
13 #include <sys/stat.h>
14
15
16 int filelength (int fd)
17 {
18         struct stat buf;
19         if (fstat (fd, &buf) == -1)
20                 return -1;
21                 
22         return buf.st_size;
23 }
24
25 int WSAGetLastError()
26 {
27         return errno;
28 }
29
30
31 #endif