diff --git a/src/build/libroot/fs_descriptors.cpp b/src/build/libroot/fs_descriptors.cpp index 2bf311dca6..68103e341c 100644 --- a/src/build/libroot/fs_descriptors.cpp +++ b/src/build/libroot/fs_descriptors.cpp @@ -1,3 +1,8 @@ +/* + * Copyright 2005-2011, Ingo Weinhold, ingo_weinhold@gmx.de. + * Distributed under the terms of the MIT License. + */ + #ifdef BUILDING_FS_SHELL # include "compat.h" @@ -507,4 +512,13 @@ delete_descriptor(int fd) return error; } + +bool +is_unknown_or_system_descriptor(int fd) +{ + Descriptor* descriptor = get_descriptor(fd); + return descriptor == NULL || descriptor->IsSystemFD(); +} + + } // namespace BPrivate diff --git a/src/build/libroot/fs_descriptors.h b/src/build/libroot/fs_descriptors.h index 608f6f6fc6..0df18381bb 100644 --- a/src/build/libroot/fs_descriptors.h +++ b/src/build/libroot/fs_descriptors.h @@ -1,3 +1,7 @@ +/* + * Copyright 2005-2011, Ingo Weinhold, ingo_weinhold@gmx.de. + * Distributed under the terms of the MIT License. + */ #ifndef FS_DESCRIPTORS_H #define FS_DESCRIPTORS_H @@ -118,6 +122,7 @@ struct AttrDirDescriptor : DirectoryDescriptor { Descriptor* get_descriptor(int fd); int add_descriptor(Descriptor *descriptor); status_t delete_descriptor(int fd); +bool is_unknown_or_system_descriptor(int fd); } // namespace BPrivate