* BEntry::GetStat() and BNode::GetStat() used sizeof(struct stat) for the kernel
syscall, but they could not know if R5 code called them (in which case the stat size has a different size). We now always only return the R5 stat structure here. This fixes bug #420. We might want to find a different solution to this problem, though. * Be got SYMLINK_MAX wrong - it's not the maximum number of links (that's SYMLOOP_MAX), but the maximum size of a symlink buffer. Added missing SYMLOOP_MAX and SYMLINK_MAX constants to limits.h. * Fixes MAXSYMLINKS to use SYMLOOP_MAX, instead of SYMLINKS_MAX (which doesn't exist in POSIX specs, but we (intentionally) break source compatibility here). * Reenabled the Haiku versions of stat(), fstat(), and lstat() when build for Haiku. * Removed OpenBeOS namespace stuff from the files I touched. * Removed superfluous StorageDefs.Private.h, whyever that ended up in a public header is beyond me. * Cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17894 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,85 +1,62 @@
|
||||
//----------------------------------------------------------------------
|
||||
// This software is part of the OpenBeOS distribution and is covered
|
||||
// by the OpenBeOS license.
|
||||
//---------------------------------------------------------------------
|
||||
/*!
|
||||
\file Statable.h
|
||||
BStatable interface declaration.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright 2002-2006, Haiku, Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _STATABLE_H
|
||||
#define _STATABLE_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <SupportDefs.h>
|
||||
|
||||
#ifdef USE_OPENBEOS_NAMESPACE
|
||||
namespace OpenBeOS {
|
||||
#endif // USE_OPENBEOS_NAMESPACE
|
||||
|
||||
struct node_ref;
|
||||
class BVolume;
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
struct node_ref;
|
||||
class BVolume;
|
||||
|
||||
|
||||
//! BStatable - A nice C++ wrapper to <code>stat()</code>
|
||||
/*! A purly abstract class which provieds an expenive, but convenet
|
||||
* C++ wrapper to the posix <code>\sa stat()</code> command.
|
||||
*
|
||||
* @see <a href="http://www.opensource.org/licenses/mit-license.html">MIT</a>
|
||||
* @author <a href="mailto:[email protected]"> Michael Lloyd Lee </a>
|
||||
* @author Be Inc
|
||||
* @version 0
|
||||
*/
|
||||
class BStatable {
|
||||
public:
|
||||
virtual status_t GetStat(struct stat *st) const = 0;
|
||||
public:
|
||||
virtual status_t GetStat(struct stat *st) const = 0;
|
||||
|
||||
bool IsFile() const;
|
||||
bool IsDirectory() const;
|
||||
bool IsSymLink() const;
|
||||
bool IsFile() const;
|
||||
bool IsDirectory() const;
|
||||
bool IsSymLink() const;
|
||||
|
||||
status_t GetNodeRef(node_ref *ref) const;
|
||||
status_t GetNodeRef(node_ref *ref) const;
|
||||
|
||||
status_t GetOwner(uid_t *owner) const;
|
||||
status_t SetOwner(uid_t owner);
|
||||
status_t GetOwner(uid_t *owner) const;
|
||||
status_t SetOwner(uid_t owner);
|
||||
|
||||
status_t GetGroup(gid_t *group) const;
|
||||
status_t SetGroup(gid_t group);
|
||||
status_t GetGroup(gid_t *group) const;
|
||||
status_t SetGroup(gid_t group);
|
||||
|
||||
status_t GetPermissions(mode_t *perms) const;
|
||||
status_t SetPermissions(mode_t perms);
|
||||
status_t GetPermissions(mode_t *perms) const;
|
||||
status_t SetPermissions(mode_t perms);
|
||||
|
||||
status_t GetSize(off_t *size) const;
|
||||
status_t GetSize(off_t *size) const;
|
||||
|
||||
status_t GetModificationTime(time_t *mtime) const;
|
||||
status_t SetModificationTime(time_t mtime);
|
||||
status_t GetModificationTime(time_t *mtime) const;
|
||||
status_t SetModificationTime(time_t mtime);
|
||||
|
||||
status_t GetCreationTime(time_t *ctime) const;
|
||||
status_t SetCreationTime(time_t ctime);
|
||||
status_t GetCreationTime(time_t *ctime) const;
|
||||
status_t SetCreationTime(time_t ctime);
|
||||
|
||||
status_t GetAccessTime(time_t *atime) const;
|
||||
status_t SetAccessTime(time_t atime);
|
||||
status_t GetAccessTime(time_t *atime) const;
|
||||
status_t SetAccessTime(time_t atime);
|
||||
|
||||
status_t GetVolume(BVolume *vol) const;
|
||||
status_t GetVolume(BVolume *vol) const;
|
||||
|
||||
private:
|
||||
private:
|
||||
friend class BEntry;
|
||||
friend class BNode;
|
||||
|
||||
friend class BEntry;
|
||||
friend class BNode;
|
||||
virtual void _OhSoStatable1();
|
||||
virtual void _OhSoStatable2();
|
||||
virtual void _OhSoStatable3();
|
||||
uint32 _reserved[4];
|
||||
|
||||
virtual void _OhSoStatable1(); //< FBC
|
||||
virtual void _OhSoStatable2(); //< FBC
|
||||
virtual void _OhSoStatable3(); //< FBC
|
||||
uint32 _ohSoData[4]; //< FBC
|
||||
|
||||
virtual status_t set_stat(struct stat &st, uint32 what) = 0;
|
||||
virtual status_t set_stat(struct stat &st, uint32 what) = 0;
|
||||
};
|
||||
|
||||
#ifdef USE_OPENBEOS_NAMESPACE
|
||||
}
|
||||
#endif // USE_OPENBEOS_NAMESPACE
|
||||
|
||||
#endif // _STATABLE_H
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user