Compilation and solving problem on mips-sony-bsd.

NAKAJI Hiroyuki nakaji at tutrp.tut.ac.jp
Thu Mar 16 01:29:38 GMT 2000


Hello,

I'm trying samba-2.0.6 on my Sony NEWS-OS 4.2.1aRD which is based on
4.3BSD, having trouble with compilation. Also I have question and want
be helped to solve the problem.

Yes, I can compile it with dirty hack which is found at
ftp://ftp.tutrp.tut.ac.jp/pub/sony-news/samba/samba-news4.diff

There are some problems about this old and specific system. 

1. It does not have setvbuf().
2. It does not have 'struct utimbuf'.
3. It has 'O_NONBLOCK' in <stream/xti.h>.
4. It does not have 'WNOHANG'.

I don't know why.

The setvbuf() can be replaced with setbuffer() and setlinebuf(), for
example, I wrote

--->8------>8------>8------>8------>8------>8------>8------>8---
Index: lib/getsmbpass.c
===================================================================
RCS file: /home/nakaji/ncvs/samba-news4/source/lib/getsmbpass.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 getsmbpass.c
--- getsmbpass.c        1999/11/08 05:13:42     1.1.1.1
+++ getsmbpass.c        1999/11/17 00:34:32
@@ -106,7 +106,11 @@
   else
     out = in;
 
+#if defined(sony_news) && defined(SYSTYPE_BSD)
+  setbuffer(in, NULL, 0);
+#else
   setvbuf(in, NULL, _IONBF, 0);
+#endif
 
   /* Turn echoing off if it is on now.  */
 
--->8------>8------>8------>8------>8------>8------>8------>8---

Of cource, this is dirty because it's very system specific. :)

For the second 'struct utimbuf' problem, I have a question. Why is
HAVE_UTIMBUF not used in any *.c or *.h files? Everywhere, 'struct
utimbuf' is used as if it is STANDARD.

My utime(3) says,

NAME
     utime - set file times

SYNOPSIS
     #include <sys/types.h>

     utime(file, timep)
     char *file;
     time_t timep[2];

while in FreeBSD's man page,

SYNOPSIS
     #include <sys/types.h>
     #include <utime.h>

     int
     utime(const char *file, const struct utimbuf *timep)

I think SAMBA should use utime() properly for both old and latest
systems.

Next question, how and where can I add '#include <stream/xti.h>'?

Finnally, what is 'WNOHANG'? I defined it to be 1 but I'm not sure.

Thanks in advance.
-- 
NAKAJI Hiroyuki


More information about the samba mailing list