unistd.c   unistd.c 
skipping to change at line 24 skipping to change at line 24
You should have received a copy of the GNU Library General Public Licens e You should have received a copy of the GNU Library General Public Licens e
along with this program; see the file COPYING. If not, write to along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. Boston, MA 02110-1301, USA.
*/ */
#define _WIN32_WINNT 0x0500 #define _WIN32_WINNT 0x0500
#include <windows.h> #include <windows.h>
#include <direct.h> #include <direct.h>
#ifdef _MSC_BUILD
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "kdewin32/unistd.h"
#else
#include "kdewin32/errno.h" #include "kdewin32/errno.h"
#include "kdewin32/fcntl.h" #include "kdewin32/fcntl.h"
#include "kdewin32/stdio.h" #include "kdewin32/stdio.h"
#include "kdewin32/stdlib.h" #include "kdewin32/stdlib.h"
#include "kdewin32/string.h" #include "kdewin32/string.h"
#include "kdewin32/sys/socket.h" #include "kdewin32/sys/socket.h"
#include "kdewin32/sys/stat.h" #include "kdewin32/sys/stat.h"
#include "kdewin32/unistd.h" #include "kdewin32/unistd.h"
#endif
#ifndef _MSC_BUILD
// BEGIN stat.c // BEGIN stat.c
int lstat(const char *path, struct stat *sb) int lstat(const char *path, struct stat *sb)
{ {
return _stat(path,(struct _stat*)sb); return _stat(path,(struct _stat*)sb);
} }
int fchmod(int __fd, mode_t __mode) int fchmod(int __fd, mode_t __mode)
{ {
return 0; return 0;
} }
// END stat.c // END stat.c
#endif
int getgroups(int size, gid_t list[]) int getgroups(int size, gid_t list[])
{ {
/* TODO */ /* TODO */
return 0; return 0;
} }
#ifndef _MSC_BUILD
int readlink(const char *__path, char *__buf, int __buflen) int readlink(const char *__path, char *__buf, int __buflen)
{ {
if (!__path) { if (!__path) {
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }
if ( (__buflen < 0) || ((int)strlen(__path)>(__buflen-1)) ) if ( (__buflen < 0) || ((int)strlen(__path)>(__buflen-1)) )
{ {
errno = ENAMETOOLONG; errno = ENAMETOOLONG;
return -1; return -1;
} }
if (access(__path, R_OK) == 0) { if (access(__path, R_OK) == 0) {
/* ok, copy to buf */ /* ok, copy to buf */
strncpy(__buf,__path,__buflen); strncpy(__buf,__path,__buflen);
errno = 0; errno = 0;
return 0; return 0;
} }
errno = ENOENT; errno = ENOENT;
return -1; return -1;
} }
#endif
int symlink(const char *__name1, const char *__name2) int symlink(const char *__name1, const char *__name2)
{ {
if(!CopyFileA(__name1, __name2, FALSE)) { if(!CopyFileA(__name1, __name2, FALSE)) {
switch(GetLastError()) { switch(GetLastError()) {
case ERROR_FILE_EXISTS: case ERROR_FILE_EXISTS:
errno = EEXIST; errno = EEXIST;
break; break;
case ERROR_CANNOT_MAKE: case ERROR_CANNOT_MAKE:
errno = EACCES; errno = EACCES;
skipping to change at line 424 skipping to change at line 437
optarg = argv[optind]; optarg = argv[optind];
return -1; return -1;
} }
next = argv[optind]; next = argv[optind];
next++; // skip past - next++; // skip past -
optind++; optind++;
} }
c = *next++; c = *next++;
cp = strchr(optstring, c); cp = (char*) strchr(optstring, c);
if (cp == NULL || c == ':') if (cp == NULL || c == ':')
return '?'; return '?';
cp++; cp++;
if (*cp == ':') if (*cp == ':')
{ {
if (*next != '\0') if (*next != '\0')
{ {
optarg = next; optarg = next;
skipping to change at line 452 skipping to change at line 465
else else
{ {
return '?'; return '?';
} }
} }
return c; return c;
} }
#endif // __MINGW32__ #endif // __MINGW32__
#ifdef _MSC_BUILD
typedef long int off_t;
#endif
int truncate(const char *path, off_t length) int truncate(const char *path, off_t length)
{ {
HANDLE hFile; HANDLE hFile;
LARGE_INTEGER fileSize; LARGE_INTEGER fileSize;
if( length < 0 ) if( length < 0 )
{ {
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }
 End of changes. 8 change blocks. 
1 lines changed or deleted 17 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/