diff options
Diffstat (limited to 'gold/descriptors.h')
-rw-r--r-- | gold/descriptors.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gold/descriptors.h b/gold/descriptors.h index 6a6ab61..359008c 100644 --- a/gold/descriptors.h +++ b/gold/descriptors.h @@ -56,6 +56,12 @@ class Descriptors void release(int descriptor, bool permanent); + // Claim the file descriptor DESCRIPTOR for a plugin. This effectively + // removes the descriptor from the pool of linker-managed descriptors, + // as the plugin will assume responsibility for closing it. + void + claim_for_plugin(int descriptor); + private: // Information kept for a descriptor. struct Open_descriptor @@ -69,6 +75,8 @@ class Descriptors bool inuse; // Whether this is a write descriptor. bool is_write; + // Whether the descriptor has been claimed for a plugin. + bool is_claimed; }; bool @@ -100,6 +108,10 @@ inline void release_descriptor(int descriptor, bool permanent) { descriptors.release(descriptor, permanent); } +inline void +claim_descriptor_for_plugin(int descriptor) +{ descriptors.claim_for_plugin(descriptor); } + } // End namespace gold. #endif // !defined(GOLD_DESCRIPTORS_H) |