Import BSDDB 4.7.25 (as of svn r89086)

This commit is contained in:
Zachary Ware
2017-09-04 13:40:25 -05:00
parent 4b29e0458f
commit 8f590873d0
4781 changed files with 2241032 additions and 6 deletions

61
os_brew/getcwd.c Normal file
View File

@@ -0,0 +1,61 @@
/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 2006,2008 Oracle. All rights reserved.
*
* $Id: getcwd.c 63573 2008-05-23 21:43:21Z trent.nelson $
*/
#include "db_config.h"
#include "db_int.h"
/*
* getcwd --
*/
char *
getcwd(buf, size)
char *buf;
size_t size;
{
IFileMgr *pIFileMgr;
int ret;
#ifndef HAVE_BREW_SDK2
int outlen;
#endif
FILE_MANAGER_CREATE(NULL, pIFileMgr, ret);
if (ret != 0) {
__os_set_errno(ret);
return (NULL);
}
buf[0] = '\0';
#ifdef AEE_SIMULATOR
/* If AEE_SIMULATOR, we should mimic the resolvepath. */
if (IFILEMGR_Test(pIFileMgr, "fs:/") == SUCCESS)
/* Current directory. */
(void)strncpy(buf, "fs:/", size - 1);
else
FILE_MANAGER_ERR(
NULL, pIFileMgr, NULL, "IFILEMGR_ResolvePath", ret);
#else
#ifndef HAVE_BREW_SDK2
outlen = size;
if (IFILEMGR_ResolvePath(pIFileMgr, ".", buf, &outlen) != SUCCESS)
FILE_MANAGER_ERR(
NULL, pIFileMgr, NULL, "IFILEMGR_ResolvePath", ret);
#endif
#endif
IFILEMGR_Release(pIFileMgr);
if (ret == 0)
return (buf);
__os_set_errno(ret);
COMPQUIET(size, 0);
return (NULL);
}