summaryrefslogtreecommitdiff
path: root/libtrivfs
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2020-03-31 20:19:47 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2020-03-31 20:19:47 +0000
commitf9cb35bcb40fd9a2a553469242189871fd558f87 (patch)
tree477b8b8fa7fd344652a088ec7a5cb9a83c2c85e3 /libtrivfs
parent23193fd35c9eaf20d794a7cc231f7c2a931a6378 (diff)
Fix build with -fno-common
which will be the default in gcc-10. * acpi/acpifs.h (fs, acpifs_maptime): Add extern qualifier. * boot/private.h (verbose): Likewise. * eth-multiplexer/netfs_impl.h (multiplexer_maptime): Likewise. * eth-multiplexer/vdev.h (port_bucket, vdev_portclass): Likewise. * exec/priv.h (port_bucket, execboot_portclass): Likewise. * ext2fs/ext2fs.h (sblock, sblock_dirty, block_size, log2_block_size, log2_dev_blocks_per_fs_block, log2_stat_blocks_per_fs_block, zeroblock, frag_size, frags_per_block, inodes_per_block, itb_per_group, db_per_group, desc_per_block, addr_per_block, groups_count, node_to_page_lock, generation_lock, next_generation, group_desc_image, global_pokel, modified_global_blocks, use_xattr_translator_records): Likewise. * hostmux/hostmux.h (hostmux_maptime): Likewise. * isofs/isofs.h (host_name, mounted_on, disk_image, disk_image_len, logical_block_size, sblock): Likewise. * libdiskfs/diskfs.h (diskfs_shortcut_symlink, diskfs_shortcut_chrdev, diskfs_shortcut_blkdev, diskfs_shortcut_fifo, diskfs_shortcut_ifsock, diskfs_create_symlink_hook, diskfs_read_symlink_hook): Likewise. * libnetfs/callbacks.h (_netfs_translator_callback1, _netfs_translator_callback2): Likewise. * libnetfs/priv.h (netfs_mtime): Likewise. * libpager/priv.h (_pager_class): Likewise. * libtrivfs/trivfs.h (trivfs_check_access_hook, trivfs_check_open_hook, trivfs_open_hook, trivfs_protid_create_hook, trivfs_peropen_create_hook, trivfs_protid_destroy_hook, trivfs_peropen_destroy_hook, trivfs_getroot_hook): Likewise. * lwip/lwip-hurd.h (lwip_bucket, socketport_class, addrport_class, shutdown_notify_class, lwip_protid_portclasses, lwip_cntl_portclasses, lwip_bootstrap_portclass, fsys_identity, lwipcntl, lwip_owner, lwip_group): Likewise. * lwip/port/include/netif/hurdtunif.h (tunnel_cntlclass, tunnel_class): Likewise. * nfs/nfs.h (main_udp_socket, hostname, mapped_time): Likewise. * nfsd/nfsd.h (mapped_time, authserver): Likewise. * pci-arbiter/pcifs.h (fs, pcifs_maptime): Likewise. * pci-arbiter/startup.h (pci_shutdown_notify_class, arrange_shutdown_notification): Likewise. * pfinet/pfinet.h (pfinet_bucket, addrport_class, socketport_class, fsys_identity, pfinetctl, pfinet_owner, pfinet_group): Likewise. * pflocal/sserver.h (sock_port_bucket): Likewise. * proc/proc.h (authserver, self_proc, init_proc, startup_proc, proc_bucket, proc_class, generic_port_class, exc_class, generic_port, kernel_proc, global_lock): Likewise. * term/term.h (termstate, termflags, global_lock, carrier_alert, select_alert, pty_select_alert, term_bucket, tty_cntl_class, tty_class, cttyid_class, pty_class, pty_cntl_class, termctl, ptyctl, inputq, rawq, outputq, remote_input_mode, external_processing, term_owner, term_group, term_mode, bottom): Likewise. * usermux/usermux.h (usermux_maptime): Likewise. * utils/msgids.h (msgid_argp): Likewise. * libdiskfs/priv.h (_diskfs_mtime): Remove definition. * lwip/options.h (lwip_argp): Add prototype. * mach-defpager/priv.h (partitions): Name structure. (all_partitions): Add extern qualifier. * acpi/main.c (acpifs_maptime, fs): New variables. * exec/main.c (port_bucket, execboot_portclass): Likewise. * ext2fs/ext2fs.c (sblock, sblock_dirty, block_size, log2_block_size, log2_dev_blocks_per_fs_block, log2_stat_blocks_per_fs_block, frag_size, frags_per_block, inodes_per_block, itb_per_group, db_per_group, desc_per_block, addr_per_block, groups_count, next_generation, group_desc_image, global_pokel, use_xattr_translator_records): Likewise. * isofs/main.c (host_name, mounted_on, logical_block_size, sblock): Likewise. * libpager/pager-create.c (_pager_class): Likewise. * lwip/port/netif/hurdtunif.c (tunnel_cntlclass, tunnel_class): Likewise. * mach-defpager/default_pager.c (all_partitions): Likewise. * nfs/main.c (main_udp_socket, hostname, mapped_time): Likewise. * nfsd/main.c (mapped_time, authserver): Likewise. * pci-arbiter/main.c (fs, pcifs_maptime): Likewise. * pci-arbiter/startup.c (*pci_shutdown_notify_class): Likewise. * pfinet/main.c (pfinetctl, pfinet_owner, pfinet_group, pfinet_bucket, addrport_class, socketport_class, fsys_identity): Likewise. * proc/main.c (authserver, self_proc, init_proc, startup_proc, proc_bucket, proc_class, generic_port_class, exc_class, generic_port, kernel_proc, global_lock): Likewise. * term/main.c (termstate, termflags, global_lock, carrier_alert, select_alert, pty_select_alert, term_bucket, tty_cntl_class, tty_class, cttyid_class, pty_class, pty_cntl_class, termctl, ptyctl, outputq, remote_input_mode, external_processing, term_owner, term_group, term_mode, bottom): Likewise. * usermux/usermux.c (usermux_mapped_time): Rename to usermux_maptime. * lwip/main.c: Include "options.h". (lwip_argp, netif_list): Remove declarations. (lwip_bucket, socketport_class, addrport_class, shutdown_notify_class, lwip_cntl_portclasses, lwip_bootstrap_portclass, lwip_owner, lwip_group, fsys_identity, lwipcntl): New variables. * eth-multiplexer/multiplexer.c (multiplexer_maptime): Add variable. * hostmux/hostmux.c (hostmux_mapped_time): Rename variable to hostmux_maptime * libdiskfs/extra-version.c: Rename file to... * libdiskfs/priv.c: ... new file. (diskfs_shortcut_symlink, diskfs_shortcut_chrdev, diskfs_shortcut_blkdev, diskfs_shortcut_fifo, diskfs_shortcut_ifsock, diskfs_create_symlink_hook, diskfs_read_symlink_hook): Add weak variables. * libdiskfs/Makefile (OTHERSRCS): Replace extra-version.c with priv.c. * libtrivfs/priv.c: New file. * libtrivfs/Makefile (OTHERSRCS): Add priv.c * libcons/extra-version.c: Rename file to... * libcons/priv.c: ... new file. * libcons/Makefile (SRCS): Replace extra-version.c with priv.c. Fix build with #
Diffstat (limited to 'libtrivfs')
-rw-r--r--libtrivfs/Makefile2
-rw-r--r--libtrivfs/priv.c61
-rw-r--r--libtrivfs/trivfs.h48
3 files changed, 86 insertions, 25 deletions
diff --git a/libtrivfs/Makefile b/libtrivfs/Makefile
index d645a0cd..7dea470a 100644
--- a/libtrivfs/Makefile
+++ b/libtrivfs/Makefile
@@ -40,7 +40,7 @@ FSYSSRCS=fsys-getroot.c fsys-goaway.c fsys-stubs.c fsys-syncfs.c \
OTHERSRCS=demuxer.c protid-clean.c protid-dup.c cntl-create.c \
cntl-clean.c times.c startup.c make-node.c make-peropen.c open.c \
runtime-argp.c set-options.c append-args.c dyn-classes.c \
- get-source.c
+ get-source.c priv.c
SRCS=$(FSSRCS) $(IOSRCS) $(FSYSSRCS) $(OTHERSRCS)
diff --git a/libtrivfs/priv.c b/libtrivfs/priv.c
new file mode 100644
index 00000000..ec2bcdfc
--- /dev/null
+++ b/libtrivfs/priv.c
@@ -0,0 +1,61 @@
+/* Default values for weak variables
+ Copyright (C) 2020 Free Software Foundation, Inc.
+
+ This file is part of the GNU Hurd.
+
+ The GNU Hurd is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2, or (at
+ your option) any later version.
+
+ The GNU Hurd is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */
+
+
+#include "priv.h"
+
+error_t (*trivfs_check_access_hook) (struct trivfs_control *cntl,
+ struct iouser *user,
+ mach_port_t realnode,
+ int *allowed)
+ __attribute__ ((weak));
+
+error_t (*trivfs_check_open_hook) (struct trivfs_control *cntl,
+ struct iouser *user, int flags)
+ __attribute__ ((weak));
+
+error_t (*trivfs_open_hook) (struct trivfs_control *fsys,
+ struct iouser *user,
+ mach_port_t dotdot,
+ int flags,
+ mach_port_t realnode,
+ struct trivfs_protid **cred)
+ __attribute__ ((weak));
+
+error_t (*trivfs_protid_create_hook) (struct trivfs_protid *)
+ __attribute__ ((weak));
+
+error_t (*trivfs_peropen_create_hook) (struct trivfs_peropen *)
+ __attribute__ ((weak));
+
+void (*trivfs_protid_destroy_hook) (struct trivfs_protid *)
+ __attribute__ ((weak));
+
+void (*trivfs_peropen_destroy_hook) (struct trivfs_peropen *)
+ __attribute__ ((weak));
+
+error_t (*trivfs_getroot_hook) (struct trivfs_control *cntl,
+ mach_port_t reply_port,
+ mach_msg_type_name_t reply_port_type,
+ mach_port_t dotdot,
+ uid_t *uids, u_int nuids, uid_t *gids, u_int ngids,
+ int flags,
+ retry_type *do_retry, char *retry_name,
+ mach_port_t *node, mach_msg_type_name_t *node_type)
+ __attribute__ ((weak));
diff --git a/libtrivfs/trivfs.h b/libtrivfs/trivfs.h
index cdb1de8c..c920b678 100644
--- a/libtrivfs/trivfs.h
+++ b/libtrivfs/trivfs.h
@@ -101,10 +101,10 @@ void trivfs_modify_stat (struct trivfs_protid *cred, io_statbuf_t *);
file permits to USER instead of checking the underlying node.
REALNODE is the underlying node, and CNTL is the trivfs control
object. The access permissions are returned in ALLOWED. */
-error_t (*trivfs_check_access_hook) (struct trivfs_control *cntl,
- struct iouser *user,
- mach_port_t realnode,
- int *allowed);
+extern error_t (*trivfs_check_access_hook) (struct trivfs_control *cntl,
+ struct iouser *user,
+ mach_port_t realnode,
+ int *allowed);
/* If this variable is set, it is called every time an open happens.
USER and FLAGS are from the open; CNTL identifies the
@@ -112,45 +112,45 @@ error_t (*trivfs_check_access_hook) (struct trivfs_control *cntl,
node. This call can block as necessary, unless O_NONBLOCK is set
in FLAGS. Any desired error can be returned, which will be reflected
to the user and prevent the open from succeeding. */
-error_t (*trivfs_check_open_hook) (struct trivfs_control *cntl,
- struct iouser *user, int flags);
+extern error_t (*trivfs_check_open_hook) (struct trivfs_control *cntl,
+ struct iouser *user, int flags);
/* If this variable is set, it is called in place of `trivfs_open' (below). */
-error_t (*trivfs_open_hook) (struct trivfs_control *fsys,
- struct iouser *user,
- mach_port_t dotdot,
- int flags,
- mach_port_t realnode,
- struct trivfs_protid **cred);
+extern error_t (*trivfs_open_hook) (struct trivfs_control *fsys,
+ struct iouser *user,
+ mach_port_t dotdot,
+ int flags,
+ mach_port_t realnode,
+ struct trivfs_protid **cred);
/* If this variable is set, it is called every time a new protid
structure is created and initialized. */
-error_t (*trivfs_protid_create_hook) (struct trivfs_protid *);
+extern error_t (*trivfs_protid_create_hook) (struct trivfs_protid *);
/* If this variable is set, it is called every time a new peropen
structure is created and initialized. */
-error_t (*trivfs_peropen_create_hook) (struct trivfs_peropen *);
+extern error_t (*trivfs_peropen_create_hook) (struct trivfs_peropen *);
/* If this variable is set, it is called every time a protid structure
is about to be destroyed. */
-void (*trivfs_protid_destroy_hook) (struct trivfs_protid *);
+extern void (*trivfs_protid_destroy_hook) (struct trivfs_protid *);
/* If this variable is set, it is called every time a peropen structure
is about to be destroyed. */
-void (*trivfs_peropen_destroy_hook) (struct trivfs_peropen *);
+extern void (*trivfs_peropen_destroy_hook) (struct trivfs_peropen *);
/* If this variable is set, it is called by trivfs_S_fsys_getroot before any
other processing takes place; if the return value is EAGAIN, normal trivfs
getroot processing continues, otherwise the rpc returns with that return
value. */
-error_t (*trivfs_getroot_hook) (struct trivfs_control *cntl,
- mach_port_t reply_port,
- mach_msg_type_name_t reply_port_type,
- mach_port_t dotdot,
- uid_t *uids, u_int nuids, uid_t *gids, u_int ngids,
- int flags,
- retry_type *do_retry, char *retry_name,
- mach_port_t *node, mach_msg_type_name_t *node_type);
+extern error_t (*trivfs_getroot_hook) (struct trivfs_control *cntl,
+ mach_port_t reply_port,
+ mach_msg_type_name_t reply_port_type,
+ mach_port_t dotdot,
+ uid_t *uids, u_int nuids, uid_t *gids, u_int ngids,
+ int flags,
+ retry_type *do_retry, char *retry_name,
+ mach_port_t *node, mach_msg_type_name_t *node_type);
/* Creates a control port for this filesystem and sends it to BOOTSTRAP with
fsys_startup. CONTROL_CLASS & CONTROL_BUCKET are passed to the ports