~ubuntu-branches/ubuntu/quantal/open-vm-tools/quantal-201207201942

« back to all changes in this revision

Viewing changes to lib/include/posix.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2009-10-18 12:28:19 UTC
  • mfrom: (1.1.7 upstream) (2.4.9 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091018122819-00vqew6m0ztpqcqp
Tags: 2009.10.15-201664-1
MergingĀ upstreamĀ versionĀ 2009.10.15-201664.

Show diffs side-by-side

added added

removed removed

Lines of Context:
84
84
int Posix_Chdir(ConstUnicode pathName);
85
85
Unicode Posix_Getenv(ConstUnicode name);
86
86
long Posix_Pathconf(ConstUnicode pathName, int name);
 
87
int Posix_Lstat(ConstUnicode pathName, struct stat *statbuf);
87
88
#endif
88
89
 
89
90
#if !defined(_WIN32)
115
116
int Posix_Execve(ConstUnicode pathName, Unicode const argVal[], 
116
117
                 Unicode const envPtr[]);
117
118
int Posix_Execvp(ConstUnicode fileName, Unicode const argVal[]);
118
 
int Posix_Lstat(ConstUnicode pathName, struct stat *statbuf);
119
119
DIR *Posix_OpenDir(ConstUnicode pathName);
120
120
int Posix_System(ConstUnicode command);
121
121
int Posix_Putenv(Unicode name);
126
126
 * freed by the caller so they must be used in the ESX environment. They
127
127
 * are different than their POSIX "base" functions.
128
128
 */
 
129
 
129
130
Unicode Posix_RealPath(ConstUnicode pathName);
130
131
Unicode Posix_ReadLink(ConstUnicode pathName);
131
132
 
132
133
struct passwd *Posix_Getpwnam(ConstUnicode name);
133
134
struct passwd *Posix_Getpwuid(uid_t uid);
134
135
 
135
 
#if !defined(sun)
136
 
int Posix_Statfs(ConstUnicode pathName, struct statfs *statfsbuf);
137
 
#endif
138
 
 
139
136
int Posix_Setenv(ConstUnicode name, ConstUnicode value, int overWrite);
140
137
 
141
138
int Posix_Getpwnam_r(ConstUnicode name, struct passwd *pw,
143
140
int Posix_Getpwuid_r(uid_t uid, struct passwd *pw,
144
141
                     char *buf, size_t size, struct passwd **ppw);
145
142
struct passwd *Posix_Getpwent(void);
146
 
#if !defined(sun)
147
 
int Posix_GetGroupList(ConstUnicode user, gid_t group, gid_t *groups,
148
 
                       int *ngroups);
149
 
#endif
150
143
struct group *Posix_Getgrnam(ConstUnicode name);
151
144
int Posix_Getgrnam_r(ConstUnicode name, struct group *gr,
152
145
                 char *buf, size_t size, struct group **pgr);
153
146
 
154
147
#if !defined(sun)
 
148
int Posix_Statfs(ConstUnicode pathName, struct statfs *statfsbuf);
 
149
 
 
150
int Posix_GetGroupList(ConstUnicode user, gid_t group, gid_t *groups,
 
151
                       int *ngroups);
 
152
 
155
153
#if !defined(__APPLE__) && !defined(__FreeBSD__)
156
154
int Posix_Mount(ConstUnicode source, ConstUnicode target,
157
155
                const char *filesystemtype, unsigned long mountflags,
207
205
 
208
206
   if (retval == 0) {
209
207
      nameUTF8 = Unicode_Alloc(nameMBCS, STRING_ENCODING_DEFAULT);
210
 
      if (!Unicode_CopyBytes(name, nameUTF8, namelen, NULL, STRING_ENCODING_UTF8)) {
 
208
      if (!Unicode_CopyBytes(name, nameUTF8, namelen, NULL,
 
209
                             STRING_ENCODING_UTF8)) {
211
210
         retval = -1;
212
211
         WSASetLastError(WSAEFAULT);
213
212
      }
264
263
         newhostent->h_name = Unicode_Alloc(hostentMBCS->h_name,
265
264
                                            STRING_ENCODING_DEFAULT);
266
265
         if (hostentMBCS->h_aliases) {
267
 
            newhostent->h_aliases = Unicode_AllocList(hostentMBCS->h_aliases, -1,
 
266
            newhostent->h_aliases = Unicode_AllocList(hostentMBCS->h_aliases,
 
267
                                                      -1,
268
268
                                                      STRING_ENCODING_DEFAULT);
269
269
         } else {
270
270
            newhostent->h_aliases = NULL;
368
368
       * fields ai_canonname (char * vs. PWSTR) and ai_next (obviously).
369
369
       */
370
370
 
371
 
      GetAddrInfoWFn = (GetAddrInfoWFnType)GetProcAddress(hWs2_32, "GetAddrInfoW");
 
371
      GetAddrInfoWFn = (GetAddrInfoWFnType)GetProcAddress(hWs2_32,
 
372
                                                          "GetAddrInfoW");
372
373
 
373
374
      if (GetAddrInfoWFn) {
374
375
         utf16_t *nodenameW = Unicode_GetAllocUTF16(nodename);
401
402
    * convert strings to and from the local encoding.
402
403
    */
403
404
 
404
 
   nodenameMBCS = (char *)Unicode_GetAllocBytes(nodename, STRING_ENCODING_DEFAULT);
405
 
   servnameMBCS = (char *)Unicode_GetAllocBytes(servname, STRING_ENCODING_DEFAULT);
 
405
   nodenameMBCS = (char *)Unicode_GetAllocBytes(nodename,
 
406
                                                STRING_ENCODING_DEFAULT);
 
407
   servnameMBCS = (char *)Unicode_GetAllocBytes(servname,
 
408
                                                STRING_ENCODING_DEFAULT);
406
409
 
407
410
   retval = getaddrinfo(nodenameMBCS, servnameMBCS, hints, res);
408
411
 
475
478
       * conversion required is between UTF-8 and UTF-16 encodings.
476
479
       */
477
480
 
478
 
      GetNameInfoWFn = (GetNameInfoWFnType)GetProcAddress(hWs2_32, "GetNameInfoW");
 
481
      GetNameInfoWFn = (GetNameInfoWFnType)GetProcAddress(hWs2_32,
 
482
                                                          "GetNameInfoW");
479
483
 
480
484
      if (GetNameInfoWFn) {
481
485
         if (host) {
485
489
            servW = (utf16_t *)Util_SafeMalloc(servlen * sizeof *servW);
486
490
         }
487
491
 
488
 
         retval = (*GetNameInfoWFn)(sa, salen, hostW, hostlen, servW, servlen, flags);
 
492
         retval = (*GetNameInfoWFn)(sa, salen, hostW, hostlen, servW,
 
493
                                    servlen, flags);
489
494
 
490
495
         if (retval == 0) {
491
496
            if (host) {
526
531
      servMBCS = (char *)Util_SafeMalloc(servlen * sizeof *servMBCS);
527
532
   }
528
533
 
529
 
   retval = getnameinfo(sa, salen, hostMBCS, hostlen, servMBCS, servlen, flags);
 
534
   retval = getnameinfo(sa, salen, hostMBCS, hostlen, servMBCS, servlen,
 
535
                        flags);
530
536
 
531
537
   if (retval == 0) {
532
538
      if (host) {