maildircreate.c
上传用户:s81996212
上传日期:2007-01-04
资源大小:722k
文件大小:1k
- /*
- ** Copyright 1998 - 1999 Double Precision, Inc.
- ** See COPYING for distribution information.
- */
- #include "maildircreate.h"
- #include <sys/types.h>
- #include <string.h>
- #include <stdio.h>
- #if HAVE_UNISTD_H
- #include <unistd.h>
- #endif
- #if HAS_GETHOSTNAME
- #else
- extern int gethostname(const char *, size_t);
- #endif
- static const char rcsid[]="$Id: maildircreate.c,v 1.2 1999/12/06 13:21:05 mrsam Exp $";
- int maildir_try_create(const char *h, /* Maildir */
- const char *u, /* Unique when creating multiple msgs by one pid */
- unsigned long n, /* If >0, we know the size of the message */
- char **tptr, /* On exit, filename in tmp */
- char **nptr) /* On exit, filename in new */
- {
- char hostname[256];
- hostname[0]=0;
- hostname[sizeof(hostname)-1]=0;
- gethostname(hostname, sizeof(hostname)-1);
- return (maildir_try_create_hostname(h, u, n, hostname, tptr, nptr));
- }