head	1.1;
access;
symbols;
locks; strict;
comment	@ * @;


1.1
date	92.06.23.18.35.21;	author mer;	state Exp;
branches;
next	;


desc
@use getpwnam to get the postgres user id.  Works with yellow pages (i hope)
@


1.1
log
@Initial revision
@
text
@/* $Header$ */

#include <stdio.h>
#include <pwd.h>

char *Usage = "Usage: pg_uid\n";

main(argc, argv)

int argc;
char **argv;

{
    struct passwd *pwe;

    if (argc != 1)
    {
	fprintf(stderr, Usage);
	exit(1);
    }
    pwe = getpwnam("postgres");
    if (!pwe)
    {
	fprintf(stderr, "user postgres does not exist\n");
	exit(1);
    }
    printf("%d\n", pwe->pw_uid);
    exit(0);
}
@
