UKERNEL: allow creation of non-detached threads
[openafs.git] / src / afs / UKERNEL / sysincludes.h
index d2b1249..f9f8e78 100644 (file)
@@ -341,26 +341,18 @@ typedef long usr_ino_t;
 #ifdef VFIFO
 #undef VFIFO
 #endif
-#ifdef VDOOR
-#undef VDOOR
-#endif
-#ifdef VBAD
-#undef VBAD
-#endif
 #ifdef VSOCK
 #undef VSOCK
 #endif
 
-#define VNON                   0
-#define VREG                   1
-#define VDIR                   2
-#define VBLK                   3
-#define VCHR                   4
-#define VLNK                   5
-#define VFIFO                  6
-#define VDOOR                  7
-#define VBAD                   8
-#define VSOCK                  9
+#define VNON 0
+#define VREG S_IFREG
+#define VDIR S_IFDIR
+#define VBLK S_IFBLK
+#define VCHR S_IFCHR
+#define VLNK S_IFLNK
+#define VSOCK S_IFSOCK
+#define VFIFO S_IFIFO
 
 typedef int usr_vtype_t;
 
@@ -960,10 +952,10 @@ extern pthread_cond_t usr_sleep_cond;
        pthread_attr_t attr; \
        assert(pthread_attr_init(&attr) == 0); \
        assert(pthread_attr_setstacksize(&attr, 124288) == 0); \
-       assert(pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED) == 0); \
        assert(pthread_create((A), &attr, (B), (void *)(C)) == 0); \
        assert(pthread_attr_destroy(&attr) == 0); \
     } while(0)
+#define usr_thread_join(A,B)   pthread_join(A, B)
 #define usr_thread_detach(A)   pthread_detach(A)
 #define usr_keycreate(A,B)     assert(pthread_key_create(A,B) == 0)
 #define usr_setspecific(A,B)   pthread_setspecific(A,B)
@@ -1013,7 +1005,7 @@ do { \
     AFS_ASSERT_GLOCK(); \
     usr_assert((vp)->v_count > 0); \
     if (--((vp)->v_count) == 0) \
-       afs_inactive(VTOAFS(vp), u.u_cred); \
+       afs_inactive(VTOAFS(vp), get_user_struct()->u_cred); \
 } while(0)
 
 struct usr_statfs {
@@ -1399,7 +1391,6 @@ struct usr_user {
     } u_r;
 };
 #define u_rval1                        u_r.r_val1
-#define u                      (*(get_user_struct()))
 
 extern struct usr_user *get_user_struct(void);