/*
* Copyright 2000, International Business Machines Corporation and others.
* All Rights Reserved.
- *
+ *
* This software has been released under the terms of the IBM Public
* License. For details, see the LICENSE file in the top-level source
* directory or online at http://www.openafs.org/dl/license10.html
#include <afsconfig.h>
#include <afs/param.h>
+#include <roken.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <sys/stat.h>
#if defined(AFS_AIX_ENV)
#include <sys/tape.h>
#include <sys/statfs.h>
#endif
#endif /* AFS_AIX_ENV */
-#include <string.h>
-#include <stdlib.h>
+#include <afs/afs_assert.h>
-#include <afs/debug.h>
#include "usd.h"
#ifdef O_LARGEFILE
usd_FileRead(usd_handle_t usd, char *buf, afs_uint32 nbytes,
afs_uint32 * xferdP)
{
- int fd = (int)(usd->handle);
+ int fd = (intptr_t)(usd->handle);
int got;
got = read(fd, buf, nbytes);
usd_FileWrite(usd_handle_t usd, char *buf, afs_uint32 nbytes,
afs_uint32 * xferdP)
{
- int fd = (int)(usd->handle);
+ int fd = (intptr_t)(usd->handle);
int sent;
sent = write(fd, buf, nbytes);
usd_FileSeek(usd_handle_t usd, afs_hyper_t reqOff, int whence,
afs_hyper_t * curOffP)
{
- int fd = (int)(usd->handle);
+ int fd = (intptr_t)(usd->handle);
osi_lloff_t lloff;
if (!osi_hFitsInOff(reqOff, lloff))
static int
usd_FileIoctl(usd_handle_t usd, int req, void *arg)
{
- int fd = (int)(usd->handle);
+ int fd = (intptr_t)(usd->handle);
#ifdef O_LARGEFILE
struct stat64 info;
#else /* O_LARGEFILE */
static int
usd_FileClose(usd_handle_t usd)
{
- int fd = (int)(usd->handle);
+ int fd = (intptr_t)(usd->handle);
int code = 0;
int ccode;
usd = (usd_handle_t) malloc(sizeof(*usd));
memset(usd, 0, sizeof(*usd));
- usd->handle = (void *)fd;
+ usd->handle = (void *)(intptr_t)fd;
usd->read = usd_FileRead;
usd->write = usd_FileWrite;
usd->seek = usd_FileSeek;
/* If we're trying to obtain a write lock on a real disk, then the
* aggregate must not be attached by the kernel. If so, unlock it
- * and fail.
+ * and fail.
* WARNING: The code to check for the above has been removed when this
* file was ported from DFS src. It should be put back if
- * this library is used to access hard disks
+ * this library is used to access hard disks
*/
}