]> git.pond.sub.org Git - empserver/blobdiff - src/lib/w32/posixio.c
Update copyright notice
[empserver] / src / lib / w32 / posixio.c
index 8a5f4b7b7f9b0e061eba91f3edf1725608fdd346..0f69f76897b2380c1a5a3a8ec861f351f05b2f79 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2007, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2009, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
  *  ---
  *
  *  posixio.c: POSIX IO emulation layer for WIN32
- * 
+ *
  *  Known contributors to this file:
  *     Ron Koenderink, 2007
+ *     Markus Armbruster, 2007-2008
  */
 
 /*
@@ -313,7 +314,7 @@ posix_socket(int domain, int type, int protocol)
 {
     SOCKET handle;
     int new_fd;
-    
+
     if ((new_fd = get_fd()) < 0)
        return -1;
 
@@ -412,6 +413,15 @@ posix_fsync(int fd)
     FILE_FUNCTION(FDMAP_IO_FILE, _commit(handle))
 }
 
+/*
+ * POSIX ftruncate()
+ */
+int
+ftruncate(int fd, off_t length)
+{
+    FILE_FUNCTION(FDMAP_IO_FILE, _chsize(handle, length))
+}
+
 /*
  * POSIX equivalent for fstat().
  * fstat() is used instead of _fstat(),
@@ -659,7 +669,7 @@ fcntl(int fd, int cmd, ...)
        if (type == FDMAP_IO_SOCKET) {
            result = WSAIoctl(handle, FIONBIO, NULL, 0,&nonblocking,
                sizeof (nonblocking), &bytes_returned, NULL, NULL);
-       
+
            if(result < 0) {
                errno = WSAGetLastError();
                return -1;