shared code. */
struct process_stratum_target
{
- /* Multiple-filesystem-aware open. Like open(2), but operating in
- the filesystem as it appears to process PID. Systems where all
- processes share a common filesystem should set this to NULL.
- If NULL, the caller should fall back to open(2). */
- int (*multifs_open) (int pid, const char *filename,
- int flags, mode_t mode);
-
- /* Multiple-filesystem-aware unlink. Like unlink(2), but operates
- in the filesystem as it appears to process PID. Systems where
- all processes share a common filesystem should set this to NULL.
- If NULL, the caller should fall back to unlink(2). */
- int (*multifs_unlink) (int pid, const char *filename);
-
- /* Multiple-filesystem-aware readlink. Like readlink(2), but
- operating in the filesystem as it appears to process PID.
- Systems where all processes share a common filesystem should
- set this to NULL. If NULL, the caller should fall back to
- readlink(2). */
- ssize_t (*multifs_readlink) (int pid, const char *filename,
- char *buf, size_t bufsiz);
-
/* Return the breakpoint kind for this target based on PC. The PCPTR is
adjusted to the real memory location in case a flag (e.g., the Thumb bit on
ARM) was present in the PC. */
string should be copied into a buffer by the client if the string
will not be immediately used, or if it must persist. */
virtual char *pid_to_exec_file (int pid);
+
+ /* Return true if any of the multifs ops is supported. */
+ virtual bool supports_multifs ();
+
+ /* Multiple-filesystem-aware open. Like open(2), but operating in
+ the filesystem as it appears to process PID. Systems where all
+ processes share a common filesystem should not override this.
+ The default behavior is to use open(2). */
+ virtual int multifs_open (int pid, const char *filename,
+ int flags, mode_t mode);
+
+ /* Multiple-filesystem-aware unlink. Like unlink(2), but operates
+ in the filesystem as it appears to process PID. Systems where
+ all processes share a common filesystem should not override this.
+ The default behavior is to use unlink(2). */
+ virtual int multifs_unlink (int pid, const char *filename);
+
+ /* Multiple-filesystem-aware readlink. Like readlink(2), but
+ operating in the filesystem as it appears to process PID.
+ Systems where all processes share a common filesystem should
+ not override this. The default behavior is to use readlink(2). */
+ virtual ssize_t multifs_readlink (int pid, const char *filename,
+ char *buf, size_t bufsiz);
};
extern process_stratum_target *the_target;