Diff
Not logged in

Differences From Artifact [d0be17b503]:

To Artifact [246bbbd514]:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/*
 * tclUnixCompat.c
 *
 * Written by: Zoran Vasiljevic (vasiljevic@users.sourceforge.net). 
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclUnixCompat.c,v 1.1.2.7 2006/09/08 19:25:13 andreas_kupries Exp $
 *
 */

#include "tclInt.h"
#include "tclPort.h"
#include <pwd.h>
#include <grp.h>








|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/*
 * tclUnixCompat.c
 *
 * Written by: Zoran Vasiljevic (vasiljevic@users.sourceforge.net). 
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclUnixCompat.c,v 1.1.2.8 2006/09/08 20:37:35 vasiljevic Exp $
 *
 */

#include "tclInt.h"
#include "tclPort.h"
#include <pwd.h>
#include <grp.h>
53
54
55
56
57
58
59
60
61

62
63
64
65
66
67
68
 * Mutex to lock access to MT-unsafe calls. This is just to protect 
 * our own usage. It does not protect us from others calling the
 * same functions without (or using some different) lock. 
 */

Tcl_Mutex compatLock;

#if (!defined(HAVE_GETHOSTBYNAME_R) || !defined(HAVE_GETHOSTBYADDR_R)) || \
    (!defined(HAVE_GETPWUID_R)      || !defined(HAVE_GETGRGID_R))



/*
 *---------------------------------------------------------------------------
 *
 * CopyArray --
 *







|
|
>







53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
 * Mutex to lock access to MT-unsafe calls. This is just to protect 
 * our own usage. It does not protect us from others calling the
 * same functions without (or using some different) lock. 
 */

Tcl_Mutex compatLock;

#if (!defined(HAVE_GETHOSTBYNAME_R) || !defined(HAVE_GETHOSTBYADDR_R) || \
     !defined(HAVE_GETPWUID_R)      || !defined(HAVE_GETGRGID_R)) && \
    (!defined(HAVE_MTSAFE_GETHOSTBYNAME) || !defined(HAVE_MTSAFE_GETHOSTBYADDR))


/*
 *---------------------------------------------------------------------------
 *
 * CopyArray --
 *
148
149
150
151
152
153
154
155
156
157
158
159

160
161
162
163
164
165
166
            return -1;
        }
        strcpy(buf, src);
    }

    return len;
}
#endif /* !defined(HAVE_GETHOSTBYNAME_R) && !defined(HAVE_GETHOSTBYADDR_R) && \
    !defined(HAVE_GETPWUID_R) && !defined(HAVE_GETGRGID_R) */


#if !defined(HAVE_GETHOSTBYNAME_R) || !defined(HAVE_GETHOSTBYADDR_R)


/*
 *---------------------------------------------------------------------------
 *
 * CopyHostnent --
 *
 *      Copies string fields of the hostnent structure to the 







|
|
|

|
>







149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
            return -1;
        }
        strcpy(buf, src);
    }

    return len;
}
#endif /* (!defined(HAVE_GETHOSTBYNAME_R) || !defined(HAVE_GETHOSTBYADDR_R) || \
           !defined(HAVE_GETPWUID_R)      || !defined(HAVE_GETGRGID_R)) && \
          (!defined(HAVE_MTSAFE_GETHOSTBYNAME) || !defined(HAVE_MTSAFE_GETHOSTBYADDR)) */

#if (!defined(HAVE_GETHOSTBYNAME_R) || !defined(HAVE_GETHOSTBYADDR_R)) && \
    (!defined(HAVE_MTSAFE_GETHOSTBYNAME) || !defined(HAVE_MTSAFE_GETHOSTBYADDR))

/*
 *---------------------------------------------------------------------------
 *
 * CopyHostnent --
 *
 *      Copies string fields of the hostnent structure to the 
205
206
207
208
209
210
211
212

213
214
215
216
217
218
219
    if (copied == -1) {
        goto range;
    }
    tgtPtr->h_addr_list = (copied > 0) ? (char **)p : NULL;
   
    return 0;
}
#endif /* !defined(HAVE_GETHOSTBYNAME_R) && !defined(HAVE_GETHOSTBYADDR_R) */


#if !defined(HAVE_GETPWUID_R)

/*
 *---------------------------------------------------------------------------
 *
 * CopyPwd --







|
>







207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
    if (copied == -1) {
        goto range;
    }
    tgtPtr->h_addr_list = (copied > 0) ? (char **)p : NULL;
   
    return 0;
}
#endif /* (!defined(HAVE_GETHOSTBYNAME_R) || !defined(HAVE_GETHOSTBYADDR_R)) && \
          (!defined(HAVE_MTSAFE_GETHOSTBYNAME) || !defined(HAVE_MTSAFE_GETHOSTBYADDR)) */

#if !defined(HAVE_GETPWUID_R)

/*
 *---------------------------------------------------------------------------
 *
 * CopyPwd --