haiku/headers/os/storage/StorageDefs.h
Axel Dörfler 7b3d36e5aa * 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
2006-06-21 13:49:16 +00:00

41 lines
1.0 KiB
C

/*
* Copyright 2002-2006, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _DEF_STORAGE_H
#define _DEF_STORAGE_H
#include <fcntl.h>
#include <sys/param.h>
#include <limits.h>
// Limits
#define B_DEV_NAME_LENGTH 128
#define B_FILE_NAME_LENGTH NAME_MAX
#define B_PATH_NAME_LENGTH MAXPATHLEN
#define B_ATTR_NAME_LENGTH (B_FILE_NAME_LENGTH-1)
#define B_MIME_TYPE_LENGTH (B_ATTR_NAME_LENGTH - 15)
#define B_MAX_SYMLINKS SYMLOOP_MAX
// Open Modes
#define B_READ_ONLY O_RDONLY // read only
#define B_WRITE_ONLY O_WRONLY // write only
#define B_READ_WRITE O_RDWR // read and write
#define B_FAIL_IF_EXISTS O_EXCL // exclusive create
#define B_CREATE_FILE O_CREAT // create the file
#define B_ERASE_FILE O_TRUNC // erase the file's data
#define B_OPEN_AT_END O_APPEND // point to the end of the data
// Node Flavors
enum node_flavor {
B_FILE_NODE = 0x01,
B_SYMLINK_NODE = 0x02,
B_DIRECTORY_NODE = 0x04,
B_ANY_NODE = 0x07
};
#endif // _DEF_STORAGE_H