Fix warnings in tviced
[openafs.git] / src / afs / UKERNEL / sysincludes.h
index cc61bbd..8645894 100644 (file)
 #endif
 #include  <stdlib.h>
 #include  <string.h>
-#include  <unistd.h>
-#include  <dirent.h>
 #include  <limits.h>
 #include  <assert.h>
 #include  <stdarg.h>
+
 #if !defined(AFS_USR_DARWIN_ENV) && !defined(AFS_USR_FBSD_ENV) /* must be included after KERNEL undef'd */
-#include <setjmp.h>
+#include  <unistd.h>
+#include  <ctype.h>
+#include  <sys/types.h>
+#include  <dirent.h>
+#include  <setjmp.h>
 #endif
 
 #ifdef AFS_USR_SUN5_ENV
 #include  <signal.h>
 #include  <sys/param.h>
-#include  <sys/types.h>
 #include  <sys/socket.h>
 #include  <net/if.h>
 #include  <sys/sockio.h>
@@ -43,7 +45,6 @@
 
 #ifdef AFS_USR_AIX_ENV
 #include  <sys/param.h>
-#include  <sys/types.h>
 #include  <sys/socket.h>
 #include  <net/if.h>
 #include  <fcntl.h>
@@ -56,7 +57,6 @@
 
 #ifdef AFS_USR_SGI_ENV
 #include  <sys/param.h>
-#include  <sys/types.h>
 #include  <sys/socket.h>
 #include  <net/if.h>
 #include  <sys/sockio.h>
@@ -70,7 +70,6 @@
 
 #ifdef AFS_USR_HPUX_ENV
 #include  <sys/param.h>
-#include  <sys/types.h>
 #include  <sys/socket.h>
 #include  <net/if.h>
 #include  <sys/file.h>
@@ -87,7 +86,6 @@
 #define AFS_USR_UNDEF_KERNEL_ENV 1
 #endif
 #include  <sys/param.h>
-#include  <sys/types.h>
 #include  <sys/socket.h>
 #include  <net/if.h>
 #include  <sys/file.h>
 #include  <netinet/in.h>
 #include  <netdb.h>
 #include  <arpa/inet.h>
+#include  <dirent.h>
+#include  <ctype.h>
+#include  <unistd.h>
 #ifndef O_SYNC
 #define O_SYNC O_FSYNC
 #endif
@@ -156,6 +157,9 @@ typedef unsigned int fsblkcnt_t;
 
 #ifdef AFS_AFSDB_ENV
 #include <arpa/nameser.h>
+#ifdef HAVE_ARPA_NAMESER_COMPAT_H
+#include <arpa/nameser_compat.h>
+#endif
 #include <resolv.h>
 #endif /* AFS_AFSDB_ENV */
 
@@ -252,6 +256,7 @@ typedef unsigned int fsblkcnt_t;
 #define offset_t               usr_offset_t
 #define getpid()               usr_getpid()
 #define setpag(A,B,C,D)                usr_setpag((A),(B),(C),(D))
+#define osi_getpid()           afs_pointer_to_int(usr_thread_self())
 #ifdef pid_t
 #undef pid_t
 #endif
@@ -839,7 +844,7 @@ enum usr_uio_rw { USR_UIO_READ, USR_UIO_WRITE };
 #endif
 #define NBPG                   4096
 
-#define panic(S)               do{fprintf(stderr, S);assert(0);}while(0)
+#define panic(S)               do{fprintf(stderr, "%s", S);assert(0);}while(0)
 #define abort()                        assert(0)
 #define usr_assert(A)          assert(A)
 
@@ -1010,7 +1015,7 @@ do { \
     AFS_ASSERT_GLOCK(); \
     usr_assert((vp)->v_count > 0); \
     if (--((vp)->v_count) == 0) \
-       afs_inactive(vp, u.u_cred); \
+       afs_inactive(VTOAFS(vp), u.u_cred); \
 } while(0)
 
 struct usr_statfs {
@@ -1220,44 +1225,44 @@ struct usr_socket {
 ((sizeof (struct usr_dirent)+4 - (MAXNAMLEN+1)) + (((len)+1 + 3) &~ 3))
 
 struct vcache;
-#define AFS_UCRED usr_ucred
+#define AFS_UCRED struct usr_ucred
 #define AFS_FLOCK       flock
 
 
 struct usr_vnodeops {
-    int (*vn_open) (char *path, int flags, int mode);
-    int (*vn_close) (int fd);
+    int (*vn_open) (struct vcache **, afs_int32, AFS_UCRED *);
+    int (*vn_close) (struct vcache *, afs_int32, AFS_UCRED *);
     int (*vn_rdwr) (struct usr_vnode *avc, struct usr_uio *uio, 
                    int rw, int io, struct usr_ucred *cred);
     int (*vn_ioctl) (void);
     int (*vn_select) (void);
-    int (*vn_getattr) (struct vcache *avc, struct vattr *, struct AFS_UCRED *);
-    int (*vn_setattr) (struct vcache *avc, struct vattr *, struct AFS_UCRED *);
-    int (*vn_access) (struct vcache *avc, afs_int32, struct AFS_UCRED *);
+    int (*vn_getattr) (struct vcache *avc, struct vattr *, AFS_UCRED *);
+    int (*vn_setattr) (struct vcache *avc, struct vattr *, AFS_UCRED *);
+    int (*vn_access) (struct vcache *avc, afs_int32, AFS_UCRED *);
     int (*vn_lookup) (struct vcache *adp, char *, struct vcache **, 
-                     struct AFS_UCRED *, int);
+                     AFS_UCRED *, int);
     int (*vn_create) (struct vcache *adp, char *, struct vattr *, 
-                     enum vcexcl, int, struct vcache **, struct AFS_UCRED *);
-    int (*vn_remove) (struct vcache *adp, char *, struct AFS_UCRED *);
+                     enum vcexcl, int, struct vcache **, AFS_UCRED *);
+    int (*vn_remove) (struct vcache *adp, char *, AFS_UCRED *);
     int (*vn_link) (struct vcache *avc, struct vcache *adp, char *, 
-                   struct AFS_UCRED *);
+                   AFS_UCRED *);
     int (*vn_rename) (struct vcache *aodp, char *, struct vcache *, char *,
-                     struct AFS_UCRED *);
+                     AFS_UCRED *);
     int (*vn_mkdir) (struct vcache *adp, char *, struct vattr *, 
-                    struct vcache **, struct AFS_UCRED *);
-    int (*vn_rmdir) (struct vcache *adp, char *, struct AFS_UCRED *);
-    int (*vn_readdir) (struct vcache *avc, struct uio *, struct AFS_UCRED *);
+                    struct vcache **, AFS_UCRED *);
+    int (*vn_rmdir) (struct vcache *adp, char *, AFS_UCRED *);
+    int (*vn_readdir) (struct vcache *avc, struct uio *, AFS_UCRED *);
     int (*vn_symlink) (struct vcache *adp, char *, struct vattr *, char *,
-                      struct AFS_UCRED *);
-    int (*vn_readlink) (struct vcache *avc, struct uio *, struct AFS_UCRED *);
-    int (*vn_fsync) (struct vcache *avc, struct AFS_UCRED *);
-    int (*vn_inactive) (struct vcache *avc, struct AFS_UCRED *acred);
+                      AFS_UCRED *);
+    int (*vn_readlink) (struct vcache *avc, struct uio *, AFS_UCRED *);
+    int (*vn_fsync) (struct vcache *avc, AFS_UCRED *);
+    int (*vn_inactive) (struct vcache *avc, AFS_UCRED *acred);
     int (*vn_bmap) (void);
     int (*vn_strategy) (void);
     int (*vn_bread) (void);
     int (*vn_brelse) (void);
     int (*vn_lockctl) (struct vcache *, struct AFS_FLOCK *, int,
-                      struct AFS_UCRED *);
+                      AFS_UCRED *);
     int (*vn_fid) (struct vcache *avc, struct fid **);
 };
 
@@ -1277,7 +1282,7 @@ extern struct usr_mount *getmp(unsigned long);
 typedef long usr_whymountroot_t;
 
 struct usr_vfsops {
-    int (*vfs_mount) (struct vfs *, char *, caddr_t);
+    int (*vfs_mount) (struct vfs *, char *, void *);
     int (*vfs_unmount) (struct vfs *);
     int (*vfs_root) (struct vfs *, struct vnode **);
     int (*vfs_statfs) (struct vfs *, struct statfs *);