bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pwd.h on VMS


From: John E. Malmberg
Subject: Re: pwd.h on VMS
Date: Mon, 03 Mar 2008 08:58:13 -0600
User-agent: Mozilla/5.0 (X11; U; OpenVMS AlphaServer_DS10_617_MHz; en-US; rv:1.7) Gecko/20040621

Bruno Haible wrote:
John E. Malmberg wrote:

In src/names.c

The declarations for getgrnam and getpwnam interfere with the ones in the system supplied headers.


--- /src_root/tar-1.19/src/names.c      Sun Aug 12 02:46:25 2007
+++ src/names.c Mon Dec 17 19:53:01 2007
@@ -27,6 +27,7 @@

/* User and group names.  */

+#ifndef __VMS /* These conflict with the VMS system supplied headers */
struct group *getgrnam ();
struct passwd *getpwnam ();
#if ! HAVE_DECL_GETPWUID
@@ -35,6 +36,7 @@
#if ! HAVE_DECL_GETGRGID
struct group *getgrgid ();
#endif
+#endif

/* Make sure you link with the proper libraries if you are running the
   Yellow Peril (thanks for the good laugh, Ian J.!), or, euh... NIS.


Can you please show the relevant part of the system-supplied headers (i.e.
the declarations of these functions and of their argument and return types?

Bruno

The protoype varies based on the compiler options, and version of VMS it is being built on.

   64 bit or 32 bit pointers;
   16 bit or 32 bit GID
   Is strict POSIX compliance required.

When strict POSIX compliance is not required, the routines on VMS take an optional parameter that indicates if they should return the path in UNIX syntax or in VMS syntax.

Turning on strict POSIX compliance makes it hard to get ported code working because it globally changes the behavior of most of the header files.

I expect that the header files will be getting a new variant in the future, as there is a bug in the VMS passwd structure where it is missing some members.

The default entry point if no header files are used will always be the one that returns the incomplete structure with 16 bit GIDs for backward compatibility.

-John
address@hidden
Personal Opinion Only


#if __USE_64BIT_FUNCS
__passwd64_ptr32
#else
__passwd_ptr32
#endif
    getpwnam(__const_char_ptr64
#if !defined(_POSIX_C_SOURCE) && __CRTL_VER >= 70100000
        , ...
#endif
        );

***************
#endif

#if __CRTL_VER >= 70312000

#  if __INITIAL_POINTER_SIZE
__passwd_ptr32 __32_getpwnam(__const_char_ptr64
#    if !defined(_POSIX_C_SOURCE) && __CRTL_VER >= 70100000
        , ...
#    endif
        );

__passwd64_ptr32 __64_getpwnam(__const_char_ptr64
#    if !defined(_POSIX_C_SOURCE) && __CRTL_VER >= 70100000
        , ...
#    endif
        );

__passwd_ptr32   __32_getpwuid(__uid_t);
__passwd64_ptr32 __64_getpwuid(__uid_t);

#  endif

int getpwnam_r(
#  if __INITIAL_POINTER_SIZE == 64
__const_char_ptr64, __passwd64_ptr64, __char_ptr64, __size_t, __passwd64
_ptr64_ptr64
#  else
__const_char_ptr64, __passwd_ptr32, __char_ptr32, __size_t, __passwd_ptr
32_ptr64
#  endif
***************
#  if __INITIAL_POINTER_SIZE
#    if __USE_LONG_GID_T
#      pragma __extern_prefix "___long_gid"
#    endif

int _getpwnam_r32(__const_char_ptr64, __passwd_ptr32, __char_ptr32, __size_t, __
passwd_ptr32_ptr64
#    if !defined(_POSIX_C_SOURCE)
        , ...
#    endif
        );
int _getpwnam_r64(__const_char_ptr64, __passwd64_ptr64, __char_ptr64, __size_t,
__passwd64_ptr64_ptr64
#    if !defined(_POSIX_C_SOURCE)
        , ...
#    endif
        );




reply via email to

[Prev in Thread] Current Thread [Next in Thread]