path2-posix.cpp revision 523f2a6676210ab8601d3fdb2fdabe7dcdea7d4c
/* $Id$ */
/** @file
* IPRT - Path Manipulation, POSIX, Part 2 - RTPathQueryInfo.
*/
/*
* Copyright (C) 2006-2010 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#define LOG_GROUP RTLOGGROUP_PATH
#include <stdlib.h>
#include <limits.h>
#include <errno.h>
#include <unistd.h>
#include <stdio.h>
#ifdef RT_OS_L4
#endif
RTR3DECL(int) RTPathQueryInfo(const char *pszPath, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs)
{
}
RTR3DECL(int) RTPathQueryInfoEx(const char *pszPath, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags)
{
/*
* Validate input.
*/
("Invalid enmAdditionalAttribs=%p\n", enmAdditionalAttribs),
/*
* Convert the filename.
*/
char const *pszNativePath;
if (RT_SUCCESS(rc))
{
if (fFlags & RTPATH_F_FOLLOW_LINK)
else
if (!rc)
{
switch (enmAdditionalAttribs)
{
case RTFSOBJATTRADD_NOTHING:
case RTFSOBJATTRADD_UNIX:
break;
break;
break;
case RTFSOBJATTRADD_EASIZE:
/** @todo Use SGI extended attribute interface to query EA info. */
break;
default:
AssertMsgFailed(("Impossible!\n"));
return VERR_INTERNAL_ERROR;
}
}
else
}
LogFlow(("RTPathQueryInfoEx(%p:{%s}, pObjInfo=%p, %d): returns %Rrc\n",
return rc;
}
RTR3DECL(int) RTPathSetTimes(const char *pszPath, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime,
{
return RTPathSetTimesEx(pszPath, pAccessTime, pModificationTime, pChangeTime, pBirthTime, RTPATH_F_ON_LINK);
}
RTR3DECL(int) RTPathSetTimesEx(const char *pszPath, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime,
{
/*
* Validate input.
*/
/*
* Convert the paths.
*/
char const *pszNativePath;
if (RT_SUCCESS(rc))
{
/*
* If it's a no-op, we'll only verify the existance of the file.
*/
if (!pAccessTime && !pModificationTime)
else
{
/*
* Convert the input to timeval, getting the missing one if necessary,
* and call the API which does the change.
*/
if (pAccessTime && pModificationTime)
{
}
else
{
if (RT_SUCCESS(rc))
{
RTTimeSpecGetTimeval(pModificationTime ? pModificationTime : &ObjInfo.ModificationTime, &aTimevals[1]);
}
else
Log(("RTPathSetTimes('%s',%p,%p,,): RTPathQueryInfo failed with %Rrc\n",
}
if (RT_SUCCESS(rc))
{
if (fFlags & RTPATH_F_FOLLOW_LINK)
{
}
|| defined(RT_OS_FREEBSD) \
|| defined(RT_OS_LINUX) \
|| defined(RT_OS_OS2) /** @todo who really has lutimes? */
else
{
}
#else
else
{
if (pAccessTime && pModificationTime)
else if (RT_SUCCESS(rc))
{
}
}
#endif
if (RT_FAILURE(rc))
Log(("RTPathSetTimes('%s',%p,%p,,): failed with %Rrc and errno=%d\n",
}
}
}
LogFlow(("RTPathSetTimes(%p:{%s}, %p:{%RDtimespec}, %p:{%RDtimespec}, %p:{%RDtimespec}, %p:{%RDtimespec}): return %Rrc\n",
return rc;
}
{
}
{
/*
* Validate input.
*/
/*
* Convert the path.
*/
char const *pszNativePath;
if (RT_SUCCESS(rc))
{
if (fFlags & RTPATH_F_FOLLOW_LINK)
{
}
#if 1
else
{
}
#else
else
{
else if (RT_SUCCESS(rc))
{
}
}
#endif
if (RT_FAILURE(rc))
Log(("RTPathSetOwnerEx('%s',%d,%d): failed with %Rrc and errno=%d\n",
}
LogFlow(("RTPathSetOwnerEx(%p:{%s}, uid, gid): return %Rrc\n",
return rc;
}