[patch] net time set && net time system on FreeBSD box with samba-3.0.11

Pavel Rochnyack rpv at muma.tusur.ru
Thu Mar 17 10:40:57 GMT 2005


Hello samba-technical,

Thursday, March 10, 2005, 6:58:47 PM, you wrote:

SS> If the +format switch is not present on all platforms, then the best
SS> thing is probably to use settimeofday(2) and avoid calling date
SS> completely.
SS> Simo.

I wrote some patch which uses settimeofday(). But I didn`t know if
exists one parameter realisation of this function or no.

We can check parameters count by autoconf:

AC_CACHE_CHECK([if settimeofday takes tz argument],samba_cv_HAVE_SETTIMEOFDAY_TZ,[
AC_TRY_COMPILE([#include <sys/time.h>],[struct timeval tv; struct timezone tz; exit(settimeofday(&tv,&tz));],
samba_cv_HAVE_SETTIMEOFDAY_TZ=yes,samba_cv_HAVE_SETTIMEOFDAY_TZ=no,samba_cv_HAVE_SETTIMEOFDAY_TZ=cross,)])
if test x"$samba_cv_HAVE_SETTIMEOFDAY_TZ" = x"yes"; then
   AC_DEFINE(HAVE_SETTIMEOFDAY_TZ,1,[Whether settimeofday() takes tz argument])
fi

If we don`t need to check parameters count patch need to be fixed and
HAVE_SETTIMEOFDAY_TZ removed. Also we can use HAVE_GETTIMEOFDAY_TZ
definition.

The "net" utility has "net time system" option, which displays time in
format ready for /bin/date. It also need to be patched for *BSD
systems.

And also we must don`t forget about documentation changes.


-- 
Best regards,
 Pavel                            mailto:rpv at muma.tusur.ru
-------------- next part --------------
A non-text attachment was scrubbed...
Name: net_time_set.patch
Type: application/octet-stream
Size: 1825 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20050317/f1a82e82/net_time_set.obj


More information about the samba-technical mailing list