summaryrefslogtreecommitdiff
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
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 #
-rw-r--r--acpi/acpifs.h4
-rw-r--r--acpi/main.c4
-rw-r--r--boot/private.h2
-rw-r--r--eth-multiplexer/multiplexer.c1
-rw-r--r--eth-multiplexer/netfs_impl.h2
-rw-r--r--eth-multiplexer/vdev.h4
-rw-r--r--exec/main.c5
-rw-r--r--exec/priv.h4
-rw-r--r--ext2fs/ext2fs.c31
-rw-r--r--ext2fs/ext2fs.h44
-rw-r--r--hostmux/hostmux.c2
-rw-r--r--hostmux/hostmux.h2
-rw-r--r--isofs/isofs.h12
-rw-r--r--isofs/main.c4
-rw-r--r--libcons/Makefile2
-rw-r--r--libcons/priv.c (renamed from libcons/extra-version.c)2
-rw-r--r--libdiskfs/Makefile2
-rw-r--r--libdiskfs/diskfs.h14
-rw-r--r--libdiskfs/priv.c (renamed from libdiskfs/extra-version.c)11
-rw-r--r--libdiskfs/priv.h2
-rw-r--r--libnetfs/callbacks.h4
-rw-r--r--libnetfs/priv.h2
-rw-r--r--libpager/pager-create.c2
-rw-r--r--libpager/priv.h2
-rw-r--r--libtrivfs/Makefile2
-rw-r--r--libtrivfs/priv.c61
-rw-r--r--libtrivfs/trivfs.h48
-rw-r--r--lwip/lwip-hurd.h22
-rw-r--r--lwip/main.c20
-rw-r--r--lwip/options.h2
-rw-r--r--lwip/port/include/netif/hurdtunif.h4
-rw-r--r--lwip/port/netif/hurdtunif.c3
-rw-r--r--mach-defpager/default_pager.c2
-rw-r--r--mach-defpager/priv.h5
-rw-r--r--nfs/main.c4
-rw-r--r--nfs/nfs.h6
-rw-r--r--nfsd/main.c4
-rw-r--r--nfsd/nfsd.h4
-rw-r--r--pci-arbiter/main.c3
-rw-r--r--pci-arbiter/pcifs.h4
-rw-r--r--pci-arbiter/startup.c2
-rw-r--r--pci-arbiter/startup.h4
-rw-r--r--pfinet/main.c10
-rw-r--r--pfinet/pfinet.h14
-rw-r--r--pflocal/sserver.h2
-rw-r--r--proc/main.c15
-rw-r--r--proc/proc.h22
-rw-r--r--term/main.c22
-rw-r--r--term/term.h42
-rw-r--r--usermux/usermux.c2
-rw-r--r--usermux/usermux.h2
-rw-r--r--utils/msgids.h2
52 files changed, 347 insertions, 150 deletions
diff --git a/acpi/acpifs.h b/acpi/acpifs.h
index 2e9063cc..8e359efb 100644
--- a/acpi/acpifs.h
+++ b/acpi/acpifs.h
@@ -104,10 +104,10 @@ struct acpifs
};
/* Main FS pointer */
-struct acpifs *fs;
+extern struct acpifs *fs;
/* Global mapped time */
-volatile struct mapped_time_value *acpifs_maptime;
+extern volatile struct mapped_time_value *acpifs_maptime;
/* Update entry and node times */
#define UPDATE_TIMES(e, what) (\
diff --git a/acpi/main.c b/acpi/main.c
index f675470c..ac325915 100644
--- a/acpi/main.c
+++ b/acpi/main.c
@@ -39,6 +39,10 @@ int netfs_maxsymlinks = 0;
char *netfs_server_name = "acpi";
char *netfs_server_version = HURD_VERSION;
+volatile struct mapped_time_value *acpifs_maptime;
+
+struct acpifs *fs;
+
int
netfs_demuxer (mach_msg_header_t * inp, mach_msg_header_t * outp)
{
diff --git a/boot/private.h b/boot/private.h
index 46362521..06181697 100644
--- a/boot/private.h
+++ b/boot/private.h
@@ -20,6 +20,6 @@
#ifndef BOOT_PRIVATE_H
#define BOOT_PRIVATE_H
-int verbose;
+extern int verbose;
#endif /* BOOT_PRIVATE_H */
diff --git a/eth-multiplexer/multiplexer.c b/eth-multiplexer/multiplexer.c
index 9b661cd5..a08b9f71 100644
--- a/eth-multiplexer/multiplexer.c
+++ b/eth-multiplexer/multiplexer.c
@@ -72,6 +72,7 @@ int netfs_maxsymlinks = 12;
char *netfs_server_name = "multiplexer";
char *netfs_server_version = HURD_VERSION;
file_t root_file;
+volatile struct mapped_time_value *multiplexer_maptime;
struct lnode root;
struct stat underlying_node_stat;
diff --git a/eth-multiplexer/netfs_impl.h b/eth-multiplexer/netfs_impl.h
index a3b4c7d6..c64fadb9 100644
--- a/eth-multiplexer/netfs_impl.h
+++ b/eth-multiplexer/netfs_impl.h
@@ -40,7 +40,7 @@ struct lnode
};
extern file_t root_file;
-volatile struct mapped_time_value *multiplexer_maptime;
+extern volatile struct mapped_time_value *multiplexer_maptime;
error_t new_node (struct lnode *ln, struct node **np);
diff --git a/eth-multiplexer/vdev.h b/eth-multiplexer/vdev.h
index 8270fedf..5a3011ad 100644
--- a/eth-multiplexer/vdev.h
+++ b/eth-multiplexer/vdev.h
@@ -33,8 +33,8 @@
#include "queue.h"
#include "util.h"
-struct port_bucket *port_bucket;
-struct port_class *vdev_portclass;
+extern struct port_bucket *port_bucket;
+extern struct port_class *vdev_portclass;
#define ETH_MTU 1500
diff --git a/exec/main.c b/exec/main.c
index 30b20da3..84745991 100644
--- a/exec/main.c
+++ b/exec/main.c
@@ -42,10 +42,15 @@ int trivfs_allow_open = 0;
struct port_class *trivfs_protid_class;
struct port_class *trivfs_control_class;
+/* Where to put the service ports. */
+struct port_bucket *port_bucket;
+struct port_class *execboot_portclass;
+
struct trivfs_control *fsys;
char **save_argv;
mach_port_t opt_device_master;
+
#include "exec_S.h"
diff --git a/exec/priv.h b/exec/priv.h
index e84d8150..07df6e8c 100644
--- a/exec/priv.h
+++ b/exec/priv.h
@@ -57,8 +57,8 @@ typedef struct bootinfo *bootinfo_t;
/* Where to put the service ports. */
-struct port_bucket *port_bucket;
-struct port_class *execboot_portclass;
+extern struct port_bucket *port_bucket;
+extern struct port_class *execboot_portclass;
extern mach_port_t procserver; /* Our proc port. */
diff --git a/ext2fs/ext2fs.c b/ext2fs/ext2fs.c
index b4c865c8..50435c76 100644
--- a/ext2fs/ext2fs.c
+++ b/ext2fs/ext2fs.c
@@ -58,6 +58,37 @@ char *diskfs_disk_name;
pthread_spinlock_t global_lock = PTHREAD_SPINLOCK_INITIALIZER;
pthread_spinlock_t modified_global_blocks_lock = PTHREAD_SPINLOCK_INITIALIZER;
+
+struct ext2_super_block *sblock;
+int sblock_dirty;
+
+unsigned int block_size;
+unsigned int log2_block_size;
+
+unsigned log2_dev_blocks_per_fs_block;
+
+unsigned log2_stat_blocks_per_fs_block;
+
+unsigned long frag_size;
+unsigned long frags_per_block;
+unsigned long inodes_per_block;
+
+unsigned long itb_per_group;
+unsigned long db_per_group;
+unsigned long desc_per_block;
+unsigned long addr_per_block;
+
+unsigned long groups_count;
+
+/* ---------------------------------------------------------------- */
+
+unsigned long next_generation;
+
+struct ext2_group_desc *group_desc_image;
+
+struct pokel global_pokel;
+
+int use_xattr_translator_records;
#ifdef EXT2FS_DEBUG
int ext2_debug_flag;
diff --git a/ext2fs/ext2fs.h b/ext2fs/ext2fs.h
index 83a6c903..2b49d2ea 100644
--- a/ext2fs/ext2fs.h
+++ b/ext2fs/ext2fs.h
@@ -284,9 +284,9 @@ void _disk_cache_block_deref (void *ptr);
int disk_cache_block_is_ref (block_t block);
/* Our in-core copy of the super-block (pointer into the disk_cache). */
-struct ext2_super_block *sblock;
+extern struct ext2_super_block *sblock;
/* True if sblock has been modified. */
-int sblock_dirty;
+extern int sblock_dirty;
/* Where the super-block is located on disk (at min-block 1). */
#define SBLOCK_BLOCK 1 /* Default location, second 1k block. */
@@ -295,21 +295,21 @@ extern unsigned int sblock_block; /* Specified location (in 1k blocks). */
#define SBLOCK_OFFS (sblock_block << 10) /* Byte offset of superblock. */
/* The filesystem block-size. */
-unsigned int block_size;
+extern unsigned int block_size;
/* The log base 2 of BLOCK_SIZE. */
-unsigned int log2_block_size;
+extern unsigned int log2_block_size;
/* The number of bits to scale min-blocks to get filesystem blocks. */
#define BLOCKSIZE_SCALE (sblock->s_log_block_size)
/* log2 of the number of device blocks in a filesystem block. */
-unsigned log2_dev_blocks_per_fs_block;
+extern unsigned log2_dev_blocks_per_fs_block;
/* log2 of the number of stat blocks (512 bytes) in a filesystem block. */
-unsigned log2_stat_blocks_per_fs_block;
+extern unsigned log2_stat_blocks_per_fs_block;
/* A handy page of page-aligned zeros. */
-vm_address_t zeroblock;
+extern vm_address_t zeroblock;
/* Get the superblock from the disk, point `sblock' to it, and setup
various global info from it. */
@@ -324,23 +324,23 @@ void map_hypermetadata ();
/* ---------------------------------------------------------------- */
/* Random stuff calculated from the super block. */
-unsigned long frag_size; /* Size of a fragment in bytes */
-unsigned long frags_per_block; /* Number of fragments per block */
-unsigned long inodes_per_block; /* Number of inodes per block */
+extern unsigned long frag_size; /* Size of a fragment in bytes */
+extern unsigned long frags_per_block; /* Number of fragments per block */
+extern unsigned long inodes_per_block; /* Number of inodes per block */
-unsigned long itb_per_group; /* Number of inode table blocks per group */
-unsigned long db_per_group; /* Number of descriptor blocks per group */
-unsigned long desc_per_block; /* Number of group descriptors per block */
-unsigned long addr_per_block; /* Number of disk addresses per block */
+extern unsigned long itb_per_group; /* Number of inode table blocks per group */
+extern unsigned long db_per_group; /* Number of descriptor blocks per group */
+extern unsigned long desc_per_block; /* Number of group descriptors per block */
+extern unsigned long addr_per_block; /* Number of disk addresses per block */
-unsigned long groups_count; /* Number of groups in the fs */
+extern unsigned long groups_count; /* Number of groups in the fs */
/* ---------------------------------------------------------------- */
-pthread_spinlock_t node_to_page_lock;
+extern pthread_spinlock_t node_to_page_lock;
-pthread_spinlock_t generation_lock;
-unsigned long next_generation;
+extern pthread_spinlock_t generation_lock;
+extern unsigned long next_generation;
/* ---------------------------------------------------------------- */
/* Functions for looking inside disk_cache */
@@ -409,7 +409,7 @@ bptr_offs (void *ptr)
stored starting in the filesystem block following the super block.
We cache a pointer into the disk image for easy lookup. */
#define group_desc(num) (&group_desc_image[num])
-struct ext2_group_desc *group_desc_image;
+extern struct ext2_group_desc *group_desc_image;
#define inode_group_num(inum) (((inum) - 1) / sblock->s_inodes_per_group)
@@ -459,12 +459,12 @@ void write_all_disknodes ();
extern pthread_spinlock_t global_lock;
/* Where to record such changes. */
-struct pokel global_pokel;
+extern struct pokel global_pokel;
/* If the block size is less than the page size, then this bitmap is used to
record which disk blocks are actually modified, so we don't stomp on parts
of the disk which are backed by file pagers. */
-unsigned char *modified_global_blocks;
+extern unsigned char *modified_global_blocks;
extern pthread_spinlock_t modified_global_blocks_lock;
/* Forward declarations for the following functions that are usually
@@ -619,6 +619,6 @@ error_t ext2_free_xattr_block (struct node *np);
*
* XXX: Remove this in Hurd 1.0 (or 0.10, or whatever follows 0.9).
*/
-int use_xattr_translator_records;
+extern int use_xattr_translator_records;
#endif
diff --git a/hostmux/hostmux.c b/hostmux/hostmux.c
index 5296527b..46483075 100644
--- a/hostmux/hostmux.c
+++ b/hostmux/hostmux.c
@@ -34,7 +34,7 @@ char *netfs_server_name = "hostmux";
char *netfs_server_version = HURD_VERSION;
int netfs_maxsymlinks = 25;
-volatile struct mapped_time_value *hostmux_mapped_time;
+volatile struct mapped_time_value *hostmux_maptime;
#define DEFAULT_HOST_PAT "${host}"
diff --git a/hostmux/hostmux.h b/hostmux/hostmux.h
index 4f971473..d3ff0180 100644
--- a/hostmux/hostmux.h
+++ b/hostmux/hostmux.h
@@ -33,7 +33,7 @@
#endif
/* Handy source of time. */
-volatile struct mapped_time_value *hostmux_maptime;
+extern volatile struct mapped_time_value *hostmux_maptime;
/* The state associated with a host multiplexer translator. */
struct hostmux
diff --git a/isofs/isofs.h b/isofs/isofs.h
index 2ba013c2..a19106fa 100644
--- a/isofs/isofs.h
+++ b/isofs/isofs.h
@@ -68,19 +68,19 @@ struct lookup_context
/* The physical media */
extern struct store *store;
-char *host_name;
+extern char *host_name;
/* Name we are mounted on, with trailing slash */
-char *mounted_on;
+extern char *mounted_on;
/* Mapped image of disk */
-void *disk_image;
-size_t disk_image_len;
+extern void *disk_image;
+extern size_t disk_image_len;
/* Processed sblock info */
/* Block size of pointers etc. on disk (6.2.2). */
-size_t logical_block_size;
+extern size_t logical_block_size;
/* Size of "logical sectors" (6.1.2). These are 2048 or the
largest power of two that will fit in a physical sector, whichever is
@@ -89,7 +89,7 @@ size_t logical_block_size;
#define logical_sector_size 2048
/* Unprocessed superblock */
-struct sblock *sblock;
+extern struct sblock *sblock;
diff --git a/isofs/main.c b/isofs/main.c
index db16e2a1..d16e7286 100644
--- a/isofs/main.c
+++ b/isofs/main.c
@@ -39,6 +39,10 @@ int diskfs_link_max = INT_MAX;
int diskfs_name_max = 255; /* see iso9660.h: struct dirrect::namelen */
int diskfs_maxsymlinks = 8;
+char *host_name;
+char *mounted_on;
+size_t logical_block_size;
+struct sblock *sblock;
/* Fetch the root node */
static void
diff --git a/libcons/Makefile b/libcons/Makefile
index a0df9f63..9ad369b7 100644
--- a/libcons/Makefile
+++ b/libcons/Makefile
@@ -19,7 +19,7 @@ dir := libcons
makemode := library
libname = libcons
-SRCS= demuxer.c init-init.c init-loop.c opts-version.c extra-version.c \
+SRCS= demuxer.c init-init.c init-loop.c opts-version.c priv.c \
dir-changed.c file-changed.c opts-std-startup.c cons-lookup.c \
cons-switch.c vcons-remove.c vcons-add.c vcons-open.c \
vcons-close.c vcons-destroy.c vcons-refresh.c vcons-scrollback.c \
diff --git a/libcons/extra-version.c b/libcons/priv.c
index 1021c878..09bd88d5 100644
--- a/libcons/extra-version.c
+++ b/libcons/priv.c
@@ -1,4 +1,4 @@
-/* Default value for cons_extra_version
+/* Default values for weak variables
Copyright (C) 2002 Free Software Foundation, Inc.
Written by Marcus Brinkmann.
diff --git a/libdiskfs/Makefile b/libdiskfs/Makefile
index 66c9f53e..aa6b24a4 100644
--- a/libdiskfs/Makefile
+++ b/libdiskfs/Makefile
@@ -52,7 +52,7 @@ OTHERSRCS = conch-fetch.c conch-set.c dir-clear.c dir-init.c dir-renamed.c \
remount.c console.c disk-pager.c \
name-cache.c direnter.c dirrewrite.c dirremove.c lookup.c dead-name.c \
validate-mode.c validate-group.c validate-author.c validate-flags.c \
- validate-rdev.c validate-owner.c extra-version.c get-source.c
+ validate-rdev.c validate-owner.c priv.c get-source.c
SRCS = $(OTHERSRCS) $(FSSRCS) $(IOSRCS) $(FSYSSRCS) $(IFSOCKSRCS)
installhdrs = diskfs.h diskfs-pager.h
diff --git a/libdiskfs/diskfs.h b/libdiskfs/diskfs.h
index 272dd57e..dfccf880 100644
--- a/libdiskfs/diskfs.h
+++ b/libdiskfs/diskfs.h
@@ -276,23 +276,23 @@ extern char *diskfs_extra_version;
if the symlink hook functions return EINVAL or are not defined.
The library knows that the dn_stat.st_size field is the length of
the symlink, even if the hook functions are used. */
-int diskfs_shortcut_symlink;
+extern int diskfs_shortcut_symlink;
/* The user may define this variable. This should be nonzero iff the
filesystem format supports shortcutting chrdev translation. */
-int diskfs_shortcut_chrdev;
+extern int diskfs_shortcut_chrdev;
/* The user may define this variable. This should be nonzero iff the
filesystem format supports shortcutting blkdev translation. */
-int diskfs_shortcut_blkdev;
+extern int diskfs_shortcut_blkdev;
/* The user may define this variable. This should be nonzero iff the
filesystem format supports shortcutting fifo translation. */
-int diskfs_shortcut_fifo;
+extern int diskfs_shortcut_fifo;
/* The user may define this variable. This should be nonzero iff the
filesystem format supports shortcutting ifsock translation. */
-int diskfs_shortcut_ifsock;
+extern int diskfs_shortcut_ifsock;
/* The user may define this variable, otherwise it has a default value of 30.
diskfs_set_sync_interval is called with this value when the first diskfs
@@ -576,13 +576,13 @@ error_t diskfs_node_reload (struct node *node);
is called to set a symlink. If it returns EINVAL or isn't set,
then the normal method (writing the contents into the file data) is
used. If it returns any other error, it is returned to the user. */
-error_t (*diskfs_create_symlink_hook)(struct node *np, const char *target);
+extern error_t (*diskfs_create_symlink_hook)(struct node *np, const char *target);
/* If this function is nonzero (and diskfs_shortcut_symlink is set) it
is called to read the contents of a symlink. If it returns EINVAL or
isn't set, then the normal method (reading from the file data) is
used. If it returns any other error, it is returned to the user. */
-error_t (*diskfs_read_symlink_hook)(struct node *np, char *target);
+extern error_t (*diskfs_read_symlink_hook)(struct node *np, char *target);
/* The user may define this function. The function must set source to
the source of the translator. The function may return an EOPNOTSUPP
diff --git a/libdiskfs/extra-version.c b/libdiskfs/priv.c
index 51920aa7..e5f0e2fd 100644
--- a/libdiskfs/extra-version.c
+++ b/libdiskfs/priv.c
@@ -1,4 +1,4 @@
-/* Default value for diskfs_extra_version
+/* Default values for weak variables
Copyright (C) 1996 Free Software Foundation, Inc.
Written by Thomas Bushnell, n/BSG.
@@ -22,3 +22,12 @@
#include "priv.h"
char *diskfs_extra_version __attribute__ ((weak)) = "";
+int diskfs_shortcut_symlink __attribute__ ((weak)) = 0;
+int diskfs_shortcut_chrdev __attribute__ ((weak)) = 0;
+int diskfs_shortcut_blkdev __attribute__ ((weak)) = 0;
+int diskfs_shortcut_fifo __attribute__ ((weak)) = 0;
+int diskfs_shortcut_ifsock __attribute__ ((weak)) = 0;
+error_t (*diskfs_create_symlink_hook)(struct node *np, const char *target)
+ __attribute__ ((weak));
+error_t (*diskfs_read_symlink_hook)(struct node *np, char *target)
+ __attribute__ ((weak));
diff --git a/libdiskfs/priv.h b/libdiskfs/priv.h
index bece45a0..5be7c2b5 100644
--- a/libdiskfs/priv.h
+++ b/libdiskfs/priv.h
@@ -52,8 +52,6 @@ extern char **_diskfs_boot_command;
/* Port cell holding a cached port to the exec server. */
extern struct hurd_port _diskfs_exec_portcell;
-volatile struct mapped_time_value *_diskfs_mtime;
-
extern const struct argp_option diskfs_common_options[];
/* Option keys for long-only options in diskfs_common_options. */
#define OPT_SUID_OK 600 /* --suid-ok */
diff --git a/libnetfs/callbacks.h b/libnetfs/callbacks.h
index 1dc3ab06..2f01ab58 100644
--- a/libnetfs/callbacks.h
+++ b/libnetfs/callbacks.h
@@ -21,5 +21,5 @@
/* Translator callback function declarations. */
-fshelp_fetch_root_callback1_t _netfs_translator_callback1;
-fshelp_fetch_root_callback2_t _netfs_translator_callback2;
+extern fshelp_fetch_root_callback1_t _netfs_translator_callback1;
+extern fshelp_fetch_root_callback2_t _netfs_translator_callback2;
diff --git a/libnetfs/priv.h b/libnetfs/priv.h
index 3871da8d..48bf67a8 100644
--- a/libnetfs/priv.h
+++ b/libnetfs/priv.h
@@ -25,7 +25,7 @@
#include "netfs.h"
-volatile struct mapped_time_value *netfs_mtime;
+extern volatile struct mapped_time_value *netfs_mtime;
static inline struct protid * __attribute__ ((unused))
begin_using_protid_port (file_t port)
diff --git a/libpager/pager-create.c b/libpager/pager-create.c
index b3b7c8f0..7f2f7d6e 100644
--- a/libpager/pager-create.c
+++ b/libpager/pager-create.c
@@ -17,6 +17,8 @@
#include "priv.h"
+struct port_class *_pager_class;
+
static struct pager *
_pager_create (size_t size,
struct port_bucket *bucket,
diff --git a/libpager/priv.h b/libpager/priv.h
index a45ae3fc..5d6a07e6 100644
--- a/libpager/priv.h
+++ b/libpager/priv.h
@@ -128,7 +128,7 @@ extern int _pager_page_errors[];
#define PM_NEXTERROR(byte) ((byte) & 0x3)
#define SET_PM_NEXTERROR(byte,err) (((byte) & ~0x3) | (err))
-struct port_class *_pager_class;
+extern struct port_class *_pager_class;
void _pager_block_termination (struct pager *);
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
diff --git a/lwip/lwip-hurd.h b/lwip/lwip-hurd.h
index 9e05550b..ab722618 100644
--- a/lwip/lwip-hurd.h
+++ b/lwip/lwip-hurd.h
@@ -30,21 +30,21 @@
#include <hurd/trivfs.h>
#include <refcount.h>
-struct port_bucket *lwip_bucket;
-struct port_class *socketport_class;
-struct port_class *addrport_class;
-struct port_class *shutdown_notify_class;
+extern struct port_bucket *lwip_bucket;
+extern struct port_class *socketport_class;
+extern struct port_class *addrport_class;
+extern struct port_class *shutdown_notify_class;
-struct port_class *lwip_protid_portclasses[2];
-struct port_class *lwip_cntl_portclasses[2];
+extern struct port_class *lwip_protid_portclasses[2];
+extern struct port_class *lwip_cntl_portclasses[2];
/* Which portclass to install on the bootstrap port, default to IPv4. */
-int lwip_bootstrap_portclass;
+extern int lwip_bootstrap_portclass;
-mach_port_t fsys_identity;
+extern mach_port_t fsys_identity;
/* Trivfs control structure for lwip. */
-struct trivfs_control *lwipcntl;
+extern struct trivfs_control *lwipcntl;
/* Address family port classes. */
enum
@@ -80,10 +80,10 @@ struct sock_addr
};
/* Owner of the underlying node. */
-uid_t lwip_owner;
+extern uid_t lwip_owner;
/* Group of the underlying node. */
-uid_t lwip_group;
+extern uid_t lwip_group;
struct socket *sock_alloc (void);
void sock_release (struct socket *);
diff --git a/lwip/main.c b/lwip/main.c
index 4dfbe143..373f3935 100644
--- a/lwip/main.c
+++ b/lwip/main.c
@@ -37,13 +37,27 @@
#include <netif/hurdethif.h>
#include <netif/hurdtunif.h>
-#include <startup.h>
+#include "startup.h"
+#include "options.h"
/* Translator initialization */
-extern struct argp lwip_argp;
+struct port_bucket *lwip_bucket;
+struct port_class *socketport_class;
+struct port_class *addrport_class;
+struct port_class *shutdown_notify_class;
-extern struct netif *netif_list;
+struct port_class *lwip_protid_portclasses[2];
+struct port_class *lwip_cntl_portclasses[2];
+
+int lwip_bootstrap_portclass;
+
+uid_t lwip_owner;
+uid_t lwip_group;
+
+mach_port_t fsys_identity;
+
+struct trivfs_control *lwipcntl;
int trivfs_fstype = FSTYPE_MISC;
int trivfs_fsid = 0;
diff --git a/lwip/options.h b/lwip/options.h
index e370fab0..7d1c96c7 100644
--- a/lwip/options.h
+++ b/lwip/options.h
@@ -78,4 +78,6 @@ static const char doc[] = "Interface-specific options before the first \
interface specification apply to the first following interface; otherwise \
they apply to the previously specified interface.";
+extern struct argp lwip_argp;
+
#endif // OPTIONS_H
diff --git a/lwip/port/include/netif/hurdtunif.h b/lwip/port/include/netif/hurdtunif.h
index 65e34ac3..43d55348 100644
--- a/lwip/port/include/netif/hurdtunif.h
+++ b/lwip/port/include/netif/hurdtunif.h
@@ -53,8 +53,8 @@ struct hurdtunif
uint8_t read_blocked;
};
-struct port_class *tunnel_cntlclass;
-struct port_class *tunnel_class;
+extern struct port_class *tunnel_cntlclass;
+extern struct port_class *tunnel_class;
/* Device initialization */
err_t hurdtunif_device_init (struct netif *netif);
diff --git a/lwip/port/netif/hurdtunif.c b/lwip/port/netif/hurdtunif.c
index 728db9ac..6e3676c7 100644
--- a/lwip/port/netif/hurdtunif.c
+++ b/lwip/port/netif/hurdtunif.c
@@ -34,6 +34,9 @@
#include <lwip-hurd.h>
+struct port_class *tunnel_cntlclass;
+struct port_class *tunnel_class;
+
/* Add to the end of the queue */
static void
enqueue (struct pbufqueue *q, struct pbuf *p)
diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c
index d2220c5a..58fddfa9 100644
--- a/mach-defpager/default_pager.c
+++ b/mach-defpager/default_pager.c
@@ -67,6 +67,8 @@
#define debug 0
+struct partitions all_partitions;
+
static char my_name[] = "(default pager):";
static void __attribute__ ((format (printf, 1, 2), unused))
diff --git a/mach-defpager/priv.h b/mach-defpager/priv.h
index a8844521..6f5aade6 100644
--- a/mach-defpager/priv.h
+++ b/mach-defpager/priv.h
@@ -61,11 +61,12 @@ struct part {
};
typedef struct part *partition_t;
-struct {
+struct partitions {
pthread_mutex_t lock;
int n_partitions;
partition_t *partition_list;/* array, for quick mapping */
-} all_partitions; /* list of all such */
+};
+extern struct partitions all_partitions; /* list of all such */
typedef unsigned char p_index_t;
diff --git a/nfs/main.c b/nfs/main.c
index c98eb567..9ea6f0bc 100644
--- a/nfs/main.c
+++ b/nfs/main.c
@@ -35,6 +35,10 @@
char *netfs_server_name = "nfs";
char *netfs_server_version = HURD_VERSION;
+int main_udp_socket;
+char *hostname;
+volatile struct mapped_time_value *mapped_time;
+
extern char *localhost ();
/* Default number of times to retry RPCs when mounted soft. */
diff --git a/nfs/nfs.h b/nfs/nfs.h
index 8424acb2..36b5ef58 100644
--- a/nfs/nfs.h
+++ b/nfs/nfs.h
@@ -79,13 +79,13 @@ struct netnode
};
/* Socket file descriptor for talking to RPC servers. */
-int main_udp_socket;
+extern int main_udp_socket;
/* Our hostname */
-char *hostname;
+extern char *hostname;
/* The current time */
-volatile struct mapped_time_value *mapped_time;
+extern volatile struct mapped_time_value *mapped_time;
/* Some tunable parameters */
diff --git a/nfsd/main.c b/nfsd/main.c
index d5607d37..ee14e240 100644
--- a/nfsd/main.c
+++ b/nfsd/main.c
@@ -27,11 +27,15 @@
#include <pthread.h>
#include <error.h>
+volatile struct mapped_time_value *mapped_time;
+
int main_udp_socket, pmap_udp_socket;
struct sockaddr_in main_address, pmap_address;
static char index_file[] = LOCALSTATEDIR "/state/misc/nfsd.index";
char *index_file_name = index_file;
+auth_t authserver;
+
/* Launch a server loop thread */
static void
create_server_thread (int socket)
diff --git a/nfsd/nfsd.h b/nfsd/nfsd.h
index 4ab558c4..7ab35726 100644
--- a/nfsd/nfsd.h
+++ b/nfsd/nfsd.h
@@ -84,7 +84,7 @@ struct proctable
struct procedure procs[];
};
-volatile struct mapped_time_value *mapped_time;
+extern volatile struct mapped_time_value *mapped_time;
#define INTSIZE(n) (((n) + 3) >> 2)
@@ -97,7 +97,7 @@ extern struct sockaddr_in main_address, pmap_address;
extern char *index_file_name;
/* Our auth server */
-auth_t authserver;
+extern auth_t authserver;
/* cache.c */
diff --git a/pci-arbiter/main.c b/pci-arbiter/main.c
index 112cd98b..181bdee2 100644
--- a/pci-arbiter/main.c
+++ b/pci-arbiter/main.c
@@ -38,6 +38,9 @@
#include "pcifs.h"
#include "startup.h"
+struct pcifs *fs;
+volatile struct mapped_time_value *pcifs_maptime;
+
/* Libnetfs stuff */
int netfs_maxsymlinks = 0;
char *netfs_server_name = "pci-arbiter";
diff --git a/pci-arbiter/pcifs.h b/pci-arbiter/pcifs.h
index deb57b06..72cf2910 100644
--- a/pci-arbiter/pcifs.h
+++ b/pci-arbiter/pcifs.h
@@ -168,10 +168,10 @@ struct pcifs
};
/* Main FS pointer */
-struct pcifs *fs;
+extern struct pcifs *fs;
/* Global mapped time */
-volatile struct mapped_time_value *pcifs_maptime;
+extern volatile struct mapped_time_value *pcifs_maptime;
/* Update entry and node times */
#define UPDATE_TIMES(e, what) (\
diff --git a/pci-arbiter/startup.c b/pci-arbiter/startup.c
index 6ffb8c60..421c9e24 100644
--- a/pci-arbiter/startup.c
+++ b/pci-arbiter/startup.c
@@ -27,6 +27,8 @@
#include <hurd/startup.h>
#include <hurd/netfs.h>
+struct port_class *pci_shutdown_notify_class;
+
void
arrange_shutdown_notification ()
{
diff --git a/pci-arbiter/startup.h b/pci-arbiter/startup.h
index 12746f3b..416b84d6 100644
--- a/pci-arbiter/startup.h
+++ b/pci-arbiter/startup.h
@@ -24,8 +24,8 @@
/* Startup and shutdown notifications management */
/* Port class for startup requests */
-struct port_class *pci_shutdown_notify_class;
+extern struct port_class *pci_shutdown_notify_class;
-void arrange_shutdown_notification ();
+void arrange_shutdown_notification (void);
#endif /* STARTUP_H */
diff --git a/pfinet/main.c b/pfinet/main.c
index 6b1b7238..cb01e0bf 100644
--- a/pfinet/main.c
+++ b/pfinet/main.c
@@ -63,8 +63,18 @@ struct port_class *pfinet_cntl_portclasses[2];
/* Which portclass to install on the bootstrap port, default to IPv4. */
int pfinet_bootstrap_portclass = PORTCLASS_INET;
+struct trivfs_control *pfinetctl;
+uid_t pfinet_owner;
+uid_t pfinet_group;
+
struct port_class *shutdown_notify_class;
+struct port_bucket *pfinet_bucket;
+struct port_class *addrport_class;
+struct port_class *socketport_class;
+
+mach_port_t fsys_identity;
+
const char *argp_program_version = STANDARD_HURD_VERSION (pfinet);
/* Option parser. */
diff --git a/pfinet/pfinet.h b/pfinet/pfinet.h
index 6e592259..d08779bf 100644
--- a/pfinet/pfinet.h
+++ b/pfinet/pfinet.h
@@ -33,11 +33,11 @@
extern pthread_mutex_t global_lock;
extern pthread_mutex_t net_bh_lock;
-struct port_bucket *pfinet_bucket;
-struct port_class *addrport_class;
-struct port_class *socketport_class;
+extern struct port_bucket *pfinet_bucket;
+extern struct port_class *addrport_class;
+extern struct port_class *socketport_class;
-mach_port_t fsys_identity;
+extern mach_port_t fsys_identity;
extern struct device *dev_base;
extern struct device loopback_dev;
@@ -58,13 +58,13 @@ struct sock_addr
};
/* Trivfs control structure for pfinet. */
-struct trivfs_control *pfinetctl;
+extern struct trivfs_control *pfinetctl;
/* Owner of the underlying node. */
-uid_t pfinet_owner;
+extern uid_t pfinet_owner;
/* Group of the underlying node. */
-uid_t pfinet_group;
+extern uid_t pfinet_group;
void ethernet_initialize (void);
int ethernet_demuxer (mach_msg_header_t *, mach_msg_header_t *);
diff --git a/pflocal/sserver.h b/pflocal/sserver.h
index a61ad916..3769b7f9 100644
--- a/pflocal/sserver.h
+++ b/pflocal/sserver.h
@@ -28,6 +28,6 @@
void ensure_sock_server ();
/* A port bucket to handle SOCK_USERs and ADDRs. */
-struct port_bucket *sock_port_bucket;
+extern struct port_bucket *sock_port_bucket;
#endif /* __SSERVER_H__ */
diff --git a/proc/main.c b/proc/main.c
index 371e0461..bb0dad0f 100644
--- a/proc/main.c
+++ b/proc/main.c
@@ -42,6 +42,21 @@ const char *argp_program_version = STANDARD_HURD_VERSION (proc);
#include "proc_exc_S.h"
#include "task_notify_S.h"
+mach_port_t authserver;
+struct proc *self_proc;
+struct proc *init_proc;
+struct proc *startup_proc;
+
+struct port_bucket *proc_bucket;
+struct port_class *proc_class;
+struct port_class *generic_port_class;
+struct port_class *exc_class;
+
+mach_port_t generic_port;
+struct proc *kernel_proc;
+
+pthread_mutex_t global_lock;
+
int
message_demuxer (mach_msg_header_t *inp,
mach_msg_header_t *outp)
diff --git a/proc/proc.h b/proc/proc.h
index a974f629..95f9e3d5 100644
--- a/proc/proc.h
+++ b/proc/proc.h
@@ -139,20 +139,20 @@ struct exc
natural_t thread_state[0];
};
-mach_port_t authserver;
-struct proc *self_proc; /* process HURD_PID_PROC (us) */
-struct proc *init_proc; /* process 1 (sysvinit) */
-struct proc *startup_proc; /* process 2 (hurd/startup) */
+extern mach_port_t authserver;
+extern struct proc *self_proc; /* process HURD_PID_PROC (us) */
+extern struct proc *init_proc; /* process 1 (sysvinit) */
+extern struct proc *startup_proc; /* process 2 (hurd/startup) */
-struct port_bucket *proc_bucket;
-struct port_class *proc_class;
-struct port_class *generic_port_class;
-struct port_class *exc_class;
+extern struct port_bucket *proc_bucket;
+extern struct port_class *proc_class;
+extern struct port_class *generic_port_class;
+extern struct port_class *exc_class;
-mach_port_t generic_port; /* messages not related to a specific proc */
-struct proc *kernel_proc;
+extern mach_port_t generic_port; /* messages not related to a specific proc */
+extern struct proc *kernel_proc;
-pthread_mutex_t global_lock;
+extern pthread_mutex_t global_lock;
extern int startup_fallback; /* (ab)use /hurd/startup's message port */
diff --git a/term/main.c b/term/main.c
index 2813d528..99ce2c66 100644
--- a/term/main.c
+++ b/term/main.c
@@ -55,6 +55,28 @@ static const char *const tty_type_names[] =
[T_PTYSLAVE] = "pty-slave",
};
+struct termios termstate;
+long termflags;
+pthread_mutex_t global_lock;
+pthread_cond_t carrier_alert;
+pthread_cond_t select_alert;
+pthread_cond_t *pty_select_alert;
+struct port_bucket *term_bucket;
+struct port_class *tty_cntl_class;
+struct port_class *tty_class;
+struct port_class *cttyid_class;
+struct port_class *pty_class;
+struct port_class *pty_cntl_class;
+struct trivfs_control *termctl;
+struct trivfs_control *ptyctl;
+struct queue *inputq, *outputq;
+int remote_input_mode;
+int external_processing;
+uid_t term_owner;
+uid_t term_group;
+mode_t term_mode;
+
+const struct bottomhalf *bottom;
/* The argument line options. */
char *tty_name;
diff --git a/term/term.h b/term/term.h
index 9125e999..3984bd7f 100644
--- a/term/term.h
+++ b/term/term.h
@@ -72,10 +72,10 @@
#define MDMCTL_SET 2
/* Directly user-visible state */
-struct termios termstate;
+extern struct termios termstate;
/* Other state with the following bits: */
-long termflags;
+extern long termflags;
#define USER_OUTPUT_SUSP 0x00000001 /* user has suspended output */
#define TTY_OPEN 0x00000002 /* someone has us open */
@@ -97,58 +97,58 @@ long termflags;
#define QUEUE_HIWAT 8100
/* Global lock */
-pthread_mutex_t global_lock;
+extern pthread_mutex_t global_lock;
/* Wakeup when NO_CARRIER turns off */
-pthread_cond_t carrier_alert;
+extern pthread_cond_t carrier_alert;
/* Wakeup for select */
-pthread_cond_t select_alert;
+extern pthread_cond_t select_alert;
/* Wakeup for pty select, if not null */
-pthread_cond_t *pty_select_alert;
+extern pthread_cond_t *pty_select_alert;
/* Bucket for all our ports. */
-struct port_bucket *term_bucket;
+extern struct port_bucket *term_bucket;
/* Port class for tty control ports */
-struct port_class *tty_cntl_class;
+extern struct port_class *tty_cntl_class;
/* Port class for tty I/O ports */
-struct port_class *tty_class;
+extern struct port_class *tty_class;
/* Port class for ctty ID ports */
-struct port_class *cttyid_class;
+extern struct port_class *cttyid_class;
/* Port class for pty master ports */
-struct port_class *pty_class;
+extern struct port_class *pty_class;
/* Port class for pty control ports */
-struct port_class *pty_cntl_class;
+extern struct port_class *pty_cntl_class;
/* Trivfs control structure for the tty */
-struct trivfs_control *termctl;
+extern struct trivfs_control *termctl;
/* Trivfs control structure for the pty */
-struct trivfs_control *ptyctl;
+extern struct trivfs_control *ptyctl;
/* The queues we use */
-struct queue *inputq, *rawq, *outputq;
+extern struct queue *inputq, *rawq, *outputq;
/* Plain pass-through input */
-int remote_input_mode;
+extern int remote_input_mode;
/* External processing mode */
-int external_processing;
+extern int external_processing;
/* Terminal owner */
-uid_t term_owner;
+extern uid_t term_owner;
/* Terminal group */
-uid_t term_group;
+extern uid_t term_group;
/* Terminal mode */
-mode_t term_mode;
+extern mode_t term_mode;
/* XXX Including <sys/ioctl.h> or <hurd/ioctl_types.h> leads to "ECHO
@@ -176,7 +176,7 @@ struct bottomhalf
error_t (*mdmstate) (int *state);
};
-const struct bottomhalf *bottom;
+extern const struct bottomhalf *bottom;
extern const struct bottomhalf devio_bottom, hurdio_bottom, ptyio_bottom;
diff --git a/usermux/usermux.c b/usermux/usermux.c
index e89177bd..1f814cbf 100644
--- a/usermux/usermux.c
+++ b/usermux/usermux.c
@@ -35,7 +35,7 @@ char *netfs_server_name = "usermux";
char *netfs_server_version = HURD_VERSION;
int netfs_maxsymlinks = 25;
-volatile struct mapped_time_value *usermux_mapped_time;
+volatile struct mapped_time_value *usermux_maptime;
#define OPT_USER_PAT 1
#define OPT_HOME_PAT 2
diff --git a/usermux/usermux.h b/usermux/usermux.h
index c9374aaa..2eed33c4 100644
--- a/usermux/usermux.h
+++ b/usermux/usermux.h
@@ -31,7 +31,7 @@ struct passwd;
#define USERMUX_FILENO_UID_OFFSET 10
/* Handy source of time. */
-volatile struct mapped_time_value *usermux_maptime;
+extern volatile struct mapped_time_value *usermux_maptime;
/* The state associated with a user multiplexer translator. */
struct usermux
diff --git a/utils/msgids.h b/utils/msgids.h
index 6bd23720..9d81bb33 100644
--- a/utils/msgids.h
+++ b/utils/msgids.h
@@ -28,6 +28,6 @@ struct msgid_info
};
const struct msgid_info *msgid_info (mach_msg_id_t msgid);
-const struct argp msgid_argp;
+extern const struct argp msgid_argp;
#endif /* _HURD_MSGIDS_H_ */