posixmodule.c.ed   [plain text]


/PyInt_FromLong((long)st->st_uid)/s//PyInt_FromLong((long)(int)st->st_uid)/
/PyInt_FromLong((long)st->st_gid)/s//PyInt_FromLong((long)(int)st->st_gid)/
/^posix_chown/a
.
/long uid, gid;/s//int uid, gid;/
/"etll:chown"/s//"etii:chown"/
/return PyInt_FromLong((long)getegid());/s//return PyInt_FromLong((long)(int)getegid());/
/return PyInt_FromLong((long)geteuid());/s//return PyInt_FromLong((long)(int)geteuid());/
/return PyInt_FromLong((long)getgid());/s//return PyInt_FromLong((long)(int)getgid());/
/^posix_getgroups/-1i
#include <pwd.h>
int getgrouplist_2(const char *name, gid_t basegid, gid_t **groups);

.
/gid_t grouplist\[MAX_GROUPS\];/c
        gid_t *grouplist = NULL;
        struct passwd *pw;
.
/n = getgroups(MAX_GROUPS, grouplist);/c
        if ((pw = getpwuid(getuid())) == NULL) {
            errno = EINVAL;
            posix_error();
            return NULL;
        }
        n = getgrouplist_2(pw->pw_name, pw->pw_gid, &grouplist);
.
/if (n < 0)/c
        if (n < 0) {
            errno = EINVAL;
.
/else {/s//} else {/
/PyInt_FromLong((long)grouplist\[i\]);/s//PyInt_FromLong((long)(int)grouplist[i]);/
/return result;/i
    if (grouplist) free(grouplist);
.
/return PyInt_FromLong((long)getuid());/s//return PyInt_FromLong((long)(int)getuid());/
/^posix_setgroups/a
.
/gid_t grouplist\[MAX_GROUPS\];/s//gid_t *grouplist;/
/if (len > MAX_GROUPS) {/a
.
.,/^[ 	]*}/c
	if ((grouplist = (gid_t *)malloc(len * sizeof(gid_t))) == NULL) {
		PyErr_NoMemory();
		return NULL;
	}
.
/if (grouplist\[i\] != x) {/s//if ((int)grouplist[i] != x) {/
/if (grouplist\[i\] != x) {/s//if ((int)grouplist[i] != x) {/
/Py_INCREF(Py_None);/i
	free(grouplist);
.
/^static struct constdef posix_constants_confstr/a
.
/^};/i
#ifdef _CS_DARWIN_USER_DIR
    {"CS_DARWIN_USER_DIR", _CS_DARWIN_USER_DIR},
#endif
#ifdef _CS_DARWIN_USER_TEMP_DIR
    {"CS_DARWIN_USER_TEMP_DIR", _CS_DARWIN_USER_TEMP_DIR},
#endif
#ifdef _CS_DARWIN_USER_CACHE_DIR
    {"CS_DARWIN_USER_CACHE_DIR", _CS_DARWIN_USER_CACHE_DIR},
#endif
.
w