xref: /illumos-gate/usr/src/cmd/sendmail/db/os/os_unlink.c (revision 7c478bd9)
1*7c478bd9Sstevel@tonic-gate /*-
2*7c478bd9Sstevel@tonic-gate  * See the file LICENSE for redistribution information.
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * Copyright (c) 1997, 1998
5*7c478bd9Sstevel@tonic-gate  *	Sleepycat Software.  All rights reserved.
6*7c478bd9Sstevel@tonic-gate  */
7*7c478bd9Sstevel@tonic-gate 
8*7c478bd9Sstevel@tonic-gate #include "config.h"
9*7c478bd9Sstevel@tonic-gate 
10*7c478bd9Sstevel@tonic-gate #ifndef lint
11*7c478bd9Sstevel@tonic-gate static const char sccsid[] = "@(#)os_unlink.c	10.7 (Sleepycat) 10/12/98";
12*7c478bd9Sstevel@tonic-gate #endif /* not lint */
13*7c478bd9Sstevel@tonic-gate 
14*7c478bd9Sstevel@tonic-gate #ifndef NO_SYSTEM_INCLUDES
15*7c478bd9Sstevel@tonic-gate #include <sys/types.h>
16*7c478bd9Sstevel@tonic-gate 
17*7c478bd9Sstevel@tonic-gate #include <errno.h>
18*7c478bd9Sstevel@tonic-gate #include <unistd.h>
19*7c478bd9Sstevel@tonic-gate #endif
20*7c478bd9Sstevel@tonic-gate 
21*7c478bd9Sstevel@tonic-gate #include "db_int.h"
22*7c478bd9Sstevel@tonic-gate #include "os_jump.h"
23*7c478bd9Sstevel@tonic-gate 
24*7c478bd9Sstevel@tonic-gate /*
25*7c478bd9Sstevel@tonic-gate  * __os_unlink --
26*7c478bd9Sstevel@tonic-gate  *	Remove a file.
27*7c478bd9Sstevel@tonic-gate  *
28*7c478bd9Sstevel@tonic-gate  * PUBLIC: int __os_unlink __P((const char *));
29*7c478bd9Sstevel@tonic-gate  */
30*7c478bd9Sstevel@tonic-gate int
__os_unlink(path)31*7c478bd9Sstevel@tonic-gate __os_unlink(path)
32*7c478bd9Sstevel@tonic-gate 	const char *path;
33*7c478bd9Sstevel@tonic-gate {
34*7c478bd9Sstevel@tonic-gate 	int ret;
35*7c478bd9Sstevel@tonic-gate 
36*7c478bd9Sstevel@tonic-gate 	ret = __db_jump.j_unlink != NULL ?
37*7c478bd9Sstevel@tonic-gate 	    __db_jump.j_unlink(path) : unlink(path);
38*7c478bd9Sstevel@tonic-gate 	return (ret == -1 ? errno : 0);
39*7c478bd9Sstevel@tonic-gate }
40