Re: Samba 3.0: vfs_netatalk.c
Have you checked we do not have a replacement function? Generally we do such function sys_something when we found system missing a needed function. Simo. On Tue, 2003-02-11 at 22:00, Anthony Liguori wrote: > > > > One catch is that there is a difference between BSD and System V > > implementations, but that's something that should be handle-able with > > ./configure. It seems to me that in either case the data could be sorted > > using the binary tree stuff or by qsort(). This should be fairly > do-able. > > On some systems, scandir() doesn't even exist. I think the only reason why > there's been any discussion as to whether this is a problem is because of > the fact that it's a module. I think the general sentiment has been that > even modules need to be concerned about portability unless there's good > reason. > > Anthony Liguori > Linux/Active Directory Interoperability > Linux Technology Center (LTC) - IBM Austin > E-mail: [EMAIL PROTECTED] > Phone: (512) 838-1208 > Tie Line: 678-1208 > > > > > "Christopher R. Hertel" <[EMAIL PROTECTED]> > > Sent by: To: > [EMAIL PROTECTED] > samba-technical-bounces+aliguor=us.ibm.com@listcc: > > s.samba.org >Subject: Re: Samba 3.0: vfs_netatalk.c > > > > > 02/11/2003 02:52 PM > > > > > > > > > Paul Green wrote: > > Anthony Liguori [mailto:aliguor at us.ibm.com] wrote: > > > > > > scandir() (and it's [alpha|version]sort() brethren) is a BSD/Linux-ism > > > and therefore isn't very portable. Since this is in a VFS module (and > > > therefore only optional) I guess this is ok. > > > > then Herb Lewis [mailto:herb at sgi.com] found this info: > > > IRIX: scandir, scandir64, alphasort, alphasort64 > > > BSD: scandir, alphasort > > > > I just checked and neither scandir* nor alphasort* are in POSIX-1996 or > > POSIX-2001. I'm not trying to build vfs_netatalk here on VOS, but if I > > was, it looks like I'd be writing some code first. I don't consider > > these functions portable either. My vote is for sticking with functions > > in POSIX if at all possible. > > > > PG > > I have not been following this thread closely, but it occurs to me that we > have tools that would make this easy to implement by hand. If I > understand the docs, the goal is to create an array of pointers to > directory entry structures (the latter allocated via malloc()). > > One catch is that there is a difference between BSD and System V > implementations, but that's something that should be handle-able with > ./configure. It seems to me that in either case the data could be sorted > using the binary tree stuff or by qsort(). This should be fairly do-able. > > Chris -)- > > -- > Samba Team -- http://www.samba.org/ -)- Christopher R. Hertel > jCIFS Team -- http://jcifs.samba.org/ -)- ubiqx development, uninq. > ubiqx Team -- http://www.ubiqx.org/ -)- [EMAIL PROTECTED] > OnLineBook -- http://ubiqx.org/cifs/-)- [EMAIL PROTECTED] -- Simo Sorce - [EMAIL PROTECTED] Xsec s.r.l. via Durando 10 Ed. G - 20158 - Milano tel. +39 02 2399 7130 - fax: +39 02 700 442 399 signature.asc Description: This is a digitally signed message part
[PATCH] Re: Samba 3.0: vfs_netatalk.c
>If you read the code, then it's pretty obvious that we just need the >entries in the directory - unsorted and one at a time. As such, my >understanding it that we can re-implement as readdir(). See attachment (See attached file: scandir.patch) Anthony Liguori Linux/Active Directory Interoperability Linux Technology Center (LTC) - IBM Austin E-mail: [EMAIL PROTECTED] Phone: (512) 838-1208 Tie Line: 678-1208 Andrew Bartlett <[EMAIL PROTECTED]> Sent by: To: "Christopher R. Hertel" <[EMAIL PROTECTED]> samba-technical-bounces+aliguor=us.ibm.com@listcc: Multiple recipients of list SAMBA-TECHNICAL s.samba.org <[EMAIL PROTECTED]> Subject: Re: Samba 3.0: vfs_netatalk.c 02/11/2003 03:11 PM On Wed, 2003-02-12 at 07:52, Christopher R. Hertel wrote: > Paul Green wrote: > > Anthony Liguori [mailto:aliguor at us.ibm.com] wrote: > > > > > > scandir() (and it's [alpha|version]sort() brethren) is a BSD/Linux-ism > > > and therefore isn't very portable. Since this is in a VFS module (and > > > therefore only optional) I guess this is ok. > > > > then Herb Lewis [mailto:herb at sgi.com] found this info: > > > IRIX: scandir, scandir64, alphasort, alphasort64 > > > BSD: scandir, alphasort > > > > I just checked and neither scandir* nor alphasort* are in POSIX-1996 or > > POSIX-2001. I'm not trying to build vfs_netatalk here on VOS, but if I > > was, it looks like I'd be writing some code first. I don't consider > > these functions portable either. My vote is for sticking with functions > > in POSIX if at all possible. > > > > PG > > I have not been following this thread closely, but it occurs to me that we > have tools that would make this easy to implement by hand. If I > understand the docs, the goal is to create an array of pointers to > directory entry structures (the latter allocated via malloc()). > > One catch is that there is a difference between BSD and System V > implementations, but that's something that should be handle-able with > ./configure. It seems to me that in either case the data could be sorted > using the binary tree stuff or by qsort(). This should be fairly do-able. If you read the code, then it's pretty obvious that we just need the entries in the directory - unsorted and one at a time. As such, my understanding it that we can re-implement as readdir(). Andrew Bartlett -- Andrew Bartlett [EMAIL PROTECTED] Manager, Authentication Subsystems, Samba Team [EMAIL PROTECTED] Student Network Administrator, Hawker College [EMAIL PROTECTED] http://samba.org http://build.samba.org http://hawkerc.net (See attached file: signature.asc) scandir.patch Description: Binary data signature.asc Description: Binary data
Re: Samba 3.0: vfs_netatalk.c
On Tue, Feb 11, 2003 at 03:23:37PM -0500, Green, Paul wrote: > Anthony Liguori [mailto:[EMAIL PROTECTED]] wrote: > > > > scandir() (and it's [alpha|version]sort() brethren) is a BSD/Linux-ism and > > therefore isn't very portable. Since this is in a VFS module (and > > therefore only optional) I guess this is ok. > > then Herb Lewis [mailto:[EMAIL PROTECTED]] found this info: > > IRIX: scandir, scandir64, alphasort, alphasort64 > > BSD: scandir, alphasort > > I just checked and neither scandir* nor alphasort* are in POSIX-1996 or > POSIX-2001. I'm not trying to build vfs_netatalk here on VOS, but if I was, > it looks like I'd be writing some code first. I don't consider these > functions portable either. My vote is for sticking with functions in POSIX > if at all possible. Indeed. We must remove non-POSIX'isms from the code asap. Jeremy.
Re: Samba 3.0: vfs_netatalk.c
On Tue, Feb 11, 2003 at 02:00:18PM -0700, Anthony Liguori wrote: > > > > > > One catch is that there is a difference between BSD and System V > > implementations, but that's something that should be handle-able with > > ./configure. It seems to me that in either case the data could be sorted > > using the binary tree stuff or by qsort(). This should be fairly > do-able. > > On some systems, scandir() doesn't even exist. I think the only reason why > there's been any discussion as to whether this is a problem is because of > the fact that it's a module. I think the general sentiment has been that > even modules need to be concerned about portability unless there's good > reason. Thus my thinking that it might be worth writing a replacement that would be platform-independent. The only hitch, I *believe*, is that there may be differences in the dirent structure between systems, but surely this is something we've solved elsewhere. Chris -)- -- Samba Team -- http://www.samba.org/ -)- Christopher R. Hertel jCIFS Team -- http://jcifs.samba.org/ -)- ubiqx development, uninq. ubiqx Team -- http://www.ubiqx.org/ -)- [EMAIL PROTECTED] OnLineBook -- http://ubiqx.org/cifs/-)- [EMAIL PROTECTED]
Re: Samba 3.0: vfs_netatalk.c
On Wed, 2003-02-12 at 07:52, Christopher R. Hertel wrote: > Paul Green wrote: > > Anthony Liguori [mailto:aliguor at us.ibm.com] wrote: > > > > > > scandir() (and it's [alpha|version]sort() brethren) is a BSD/Linux-ism > > > and therefore isn't very portable. Since this is in a VFS module (and > > > therefore only optional) I guess this is ok. > > > > then Herb Lewis [mailto:herb at sgi.com] found this info: > > > IRIX: scandir, scandir64, alphasort, alphasort64 > > > BSD: scandir, alphasort > > > > I just checked and neither scandir* nor alphasort* are in POSIX-1996 or > > POSIX-2001. I'm not trying to build vfs_netatalk here on VOS, but if I > > was, it looks like I'd be writing some code first. I don't consider > > these functions portable either. My vote is for sticking with functions > > in POSIX if at all possible. > > > > PG > > I have not been following this thread closely, but it occurs to me that we > have tools that would make this easy to implement by hand. If I > understand the docs, the goal is to create an array of pointers to > directory entry structures (the latter allocated via malloc()). > > One catch is that there is a difference between BSD and System V > implementations, but that's something that should be handle-able with > ./configure. It seems to me that in either case the data could be sorted > using the binary tree stuff or by qsort(). This should be fairly do-able. If you read the code, then it's pretty obvious that we just need the entries in the directory - unsorted and one at a time. As such, my understanding it that we can re-implement as readdir(). Andrew Bartlett -- Andrew Bartlett [EMAIL PROTECTED] Manager, Authentication Subsystems, Samba Team [EMAIL PROTECTED] Student Network Administrator, Hawker College [EMAIL PROTECTED] http://samba.org http://build.samba.org http://hawkerc.net signature.asc Description: This is a digitally signed message part
Re: Samba 3.0: vfs_netatalk.c
> One catch is that there is a difference between BSD and System V > implementations, but that's something that should be handle-able with > ./configure. It seems to me that in either case the data could be sorted > using the binary tree stuff or by qsort(). This should be fairly do-able. On some systems, scandir() doesn't even exist. I think the only reason why there's been any discussion as to whether this is a problem is because of the fact that it's a module. I think the general sentiment has been that even modules need to be concerned about portability unless there's good reason. Anthony Liguori Linux/Active Directory Interoperability Linux Technology Center (LTC) - IBM Austin E-mail: [EMAIL PROTECTED] Phone: (512) 838-1208 Tie Line: 678-1208 "Christopher R. Hertel" <[EMAIL PROTECTED]> Sent by: To: [EMAIL PROTECTED] samba-technical-bounces+aliguor=us.ibm.com@listcc: s.samba.org Subject: Re: Samba 3.0: vfs_netatalk.c 02/11/2003 02:52 PM Paul Green wrote: > Anthony Liguori [mailto:aliguor at us.ibm.com] wrote: > > > > scandir() (and it's [alpha|version]sort() brethren) is a BSD/Linux-ism > > and therefore isn't very portable. Since this is in a VFS module (and > > therefore only optional) I guess this is ok. > > then Herb Lewis [mailto:herb at sgi.com] found this info: > > IRIX: scandir, scandir64, alphasort, alphasort64 > > BSD: scandir, alphasort > > I just checked and neither scandir* nor alphasort* are in POSIX-1996 or > POSIX-2001. I'm not trying to build vfs_netatalk here on VOS, but if I > was, it looks like I'd be writing some code first. I don't consider > these functions portable either. My vote is for sticking with functions > in POSIX if at all possible. > > PG I have not been following this thread closely, but it occurs to me that we have tools that would make this easy to implement by hand. If I understand the docs, the goal is to create an array of pointers to directory entry structures (the latter allocated via malloc()). One catch is that there is a difference between BSD and System V implementations, but that's something that should be handle-able with ./configure. It seems to me that in either case the data could be sorted using the binary tree stuff or by qsort(). This should be fairly do-able. Chris -)- -- Samba Team -- http://www.samba.org/ -)- Christopher R. Hertel jCIFS Team -- http://jcifs.samba.org/ -)- ubiqx development, uninq. ubiqx Team -- http://www.ubiqx.org/ -)- [EMAIL PROTECTED] OnLineBook -- http://ubiqx.org/cifs/-)- [EMAIL PROTECTED]
Re: Samba 3.0: vfs_netatalk.c
Paul Green wrote: > Anthony Liguori [mailto:aliguor at us.ibm.com] wrote: > > > > scandir() (and it's [alpha|version]sort() brethren) is a BSD/Linux-ism > > and therefore isn't very portable. Since this is in a VFS module (and > > therefore only optional) I guess this is ok. > > then Herb Lewis [mailto:herb at sgi.com] found this info: > > IRIX: scandir, scandir64, alphasort, alphasort64 > > BSD: scandir, alphasort > > I just checked and neither scandir* nor alphasort* are in POSIX-1996 or > POSIX-2001. I'm not trying to build vfs_netatalk here on VOS, but if I > was, it looks like I'd be writing some code first. I don't consider > these functions portable either. My vote is for sticking with functions > in POSIX if at all possible. > > PG I have not been following this thread closely, but it occurs to me that we have tools that would make this easy to implement by hand. If I understand the docs, the goal is to create an array of pointers to directory entry structures (the latter allocated via malloc()). One catch is that there is a difference between BSD and System V implementations, but that's something that should be handle-able with ./configure. It seems to me that in either case the data could be sorted using the binary tree stuff or by qsort(). This should be fairly do-able. Chris -)- -- Samba Team -- http://www.samba.org/ -)- Christopher R. Hertel jCIFS Team -- http://jcifs.samba.org/ -)- ubiqx development, uninq. ubiqx Team -- http://www.ubiqx.org/ -)- [EMAIL PROTECTED] OnLineBook -- http://ubiqx.org/cifs/-)- [EMAIL PROTECTED]
RE: Samba 3.0: vfs_netatalk.c
Anthony Liguori [mailto:[EMAIL PROTECTED]] wrote: > > scandir() (and it's [alpha|version]sort() brethren) is a BSD/Linux-ism and > therefore isn't very portable. Since this is in a VFS module (and > therefore only optional) I guess this is ok. then Herb Lewis [mailto:[EMAIL PROTECTED]] found this info: > IRIX: scandir, scandir64, alphasort, alphasort64 > BSD: scandir, alphasort I just checked and neither scandir* nor alphasort* are in POSIX-1996 or POSIX-2001. I'm not trying to build vfs_netatalk here on VOS, but if I was, it looks like I'd be writing some code first. I don't consider these functions portable either. My vote is for sticking with functions in POSIX if at all possible. PG -- Paul Green, Senior Technical Consultant, Stratus Technologies. Day: +1 978-461-7557; FAX: +1 978-461-3610 Speaking from Stratus not for Stratus
Re: Samba 3.0: vfs_netatalk.c
The IRIX manpage shows SCANDIR(3C) NAME scandir, scandir64, alphasort, alphasort64 - scan a directory SYNOPSIS SysV: #include #include int scandir(const char *dirname, struct dirent **namelist[], int (*select)(struct dirent *), int (*compar)(struct dirent **, struct dirent **)); int alphasort(struct dirent **d1, struct dirent **d2); int scandir64(const char *dirname, struct dirent64 **namelist[], int (*select)(struct dirent64 *), int (*compar)(struct dirent64 **, struct dirent64 **)); int alphasort64(struct dirent64 **d1, struct dirent64 **d2); BSD: #include #include int scandir(const char *dirname, struct direct **namelist[], int (*select)(), int (*compar)()); int alphasort(struct direct **d1, struct direct **d2); Anthony Liguori wrote: > > scandir() (and it's [alpha|version]sort() brethren) is a BSD/Linux-ism and > therefore isn't very portable. Since this is in a VFS module (and > therefore only optional) I guess this is ok. > > Anthony Liguori > Linux/Active Directory Interoperability > Linux Technology Center (LTC) - IBM Austin > E-mail: [EMAIL PROTECTED] > Phone: (512) 838-1208 > Tie Line: 678-1208 -- == Herb Lewis Silicon Graphics Networking Engineer 1600 Amphitheatre Pkwy MS-510 Strategic Software Organization Mountain View, CA 94043-1351 [EMAIL PROTECTED] Tel: 650-933-2177 http://www.sgi.com Fax: 650-932-2177 PGP Key: 0x8408D65D ==
Re: Samba 3.0: vfs_netatalk.c
On Tue, 2003-02-11 at 07:54, Anthony Liguori wrote: > > > > > scandir() (and it's [alpha|version]sort() brethren) is a BSD/Linux-ism and > therefore isn't very portable. Since this is in a VFS module (and > therefore only optional) I guess this is ok. No, it's not really. Given all we really want is opendir()/readdir(), using scandir() here really isn't excusable. I had been meaning to fire off some e-mails on this. All our VFS modules should build on all platforms, unless there is a *really good* reason not to. (Like MySQL not present). The reason for this, is that code gets copied around, and having 'lower quality' code that doesn't always compile will mean that people will follow the bad examples. Also, compiling code on things like Stratus VOS, or SCO Unix etc is not just because we like wide support - these compilers often have some *very* nice warning support. Due to different word orders, word sizes etc, or just some nice warning that other compilers don't have, they *find bugs*. Andrew Bartlett
Re: Samba 3.0: vfs_netatalk.c
scandir() (and it's [alpha|version]sort() brethren) is a BSD/Linux-ism and therefore isn't very portable. Since this is in a VFS module (and therefore only optional) I guess this is ok. Anthony Liguori Linux/Active Directory Interoperability Linux Technology Center (LTC) - IBM Austin E-mail: [EMAIL PROTECTED] Phone: (512) 838-1208 Tie Line: 678-1208
Samba 3.0: vfs_netatalk.c
There appears to be a typo in the atalk_rrmdir function. The function calls the built in scandir() function and tries to pass alphasort as its last argument. It complains about alphasort not being a declared variable. From what I understand of scandir that last argument is supposed to be a non-NULL pointer if qsort() is to sort the directory listing. Should it be passing aplhasort()? If someone could check this out, I think it would clear up alot of failures in the build_farm. Thanks, Joe Meslovich Joe Meslovich [EMAIL PROTECTED] Associate Network/Systems Engineer IT Center Tel: (540) 828 - 5343