1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
|
Use libc's __extern_inline which works properly according to optimization flags
---
libdiskfs/diskfs.h | 17 ++++++----
libpipe/pipe.h | 74 ++++++++++++++++++++++++++++++++------------
libpipe/pq.h | 57 ++++++++++++++++++++++++++-------
libshouldbeinlibc/idvec.h | 29 ++++++++++++-----
libshouldbeinlibc/maptime.h | 13 ++++---
libshouldbeinlibc/ugids.h | 25 ++++++++++----
libstore/store.h | 13 ++++---
libthreads/rwlock.h | 27 +++++++++++-----
8 files changed, 184 insertions(+), 71 deletions(-)
--- a/libdiskfs/diskfs.h
+++ b/libdiskfs/diskfs.h
@@ -27,10 +27,7 @@
#include <hurd/fshelp.h>
#include <hurd/iohelp.h>
#include <idvec.h>
-
-#ifndef DISKFS_EXTERN_INLINE
-#define DISKFS_EXTERN_INLINE extern inline
-#endif
+#include <features.h>
/* Each user port referring to a file points to one of these
(with the aid of the ports library). */
@@ -781,10 +778,16 @@ error_t diskfs_start_protid (struct pero
the user to install is USER. */
void diskfs_finish_protid (struct protid *cred, struct iouser *user);
+extern struct protid * diskfs_begin_using_protid_port (file_t port);
+
+extern void diskfs_end_using_protid_port (struct protid *cred);
+
+# ifdef __USE_EXTERN_INLINES
+
/* Called by MiG to translate ports into struct protid *.
fsmutations.h arranges for this to happen for the io and
fs interfaces. */
-DISKFS_EXTERN_INLINE struct protid *
+__extern_inline struct protid *
diskfs_begin_using_protid_port (file_t port)
{
return ports_lookup_port (diskfs_port_bucket, port, diskfs_protid_class);
@@ -793,13 +796,15 @@ diskfs_begin_using_protid_port (file_t p
/* Called by MiG after server routines have been run; this
balances begin_using_protid_port, and is arranged for the io
and fs interfaces by fsmutations.h. */
-DISKFS_EXTERN_INLINE void
+__extern_inline void
diskfs_end_using_protid_port (struct protid *cred)
{
if (cred)
ports_port_deref (cred);
}
+# endif /* Use extern inlines. */
+
/* Called when a protid CRED has no more references. (Because references\
to protids are maintained by the port management library, this is
installed in the clean routines list.) The ports library will
--- a/libpipe/pipe.h
+++ b/libpipe/pipe.h
@@ -24,13 +24,10 @@
#define EWOULDBLOCK EAGAIN /* XXX */
#include <cthreads.h> /* For conditions & mutexes */
+#include <features.h>
#include "pq.h"
-#ifndef PIPE_EI
-#define PIPE_EI extern inline
-#endif
-
/* A description of a class of pipes and how to operate on them. */
struct pipe_class
@@ -107,9 +104,24 @@ struct pipe
/* Pipe flags. */
#define PIPE_BROKEN 0x1 /* This pipe isn't connected. */
+
+extern size_t pipe_readable (struct pipe *pipe, int data_only);
+
+extern int pipe_is_readable (struct pipe *pipe, int data_only);
+
+extern error_t pipe_wait_readable (struct pipe *pipe, int noblock, int data_only);
+
+extern error_t pipe_select_readable (struct pipe *pipe, int data_only);
+
+extern error_t pipe_wait_writable (struct pipe *pipe, int noblock);
+
+extern error_t pipe_select_writable (struct pipe *pipe);
+
+# ifdef __USE_EXTERN_INLINES
+
/* Returns the number of characters quickly readable from PIPE. If DATA_ONLY
is true, then `control' packets are ignored. */
-PIPE_EI size_t
+__extern_inline size_t
pipe_readable (struct pipe *pipe, int data_only)
{
size_t readable = 0;
@@ -128,7 +140,7 @@ pipe_readable (struct pipe *pipe, int da
then `control' packets are ignored. Note that this is different than
(pipe_readable (PIPE) > 0) in the case where a control packet containing
only ports is present. */
-PIPE_EI int
+__extern_inline int
pipe_is_readable (struct pipe *pipe, int data_only)
{
struct pq *pq = pipe->queue;
@@ -143,7 +155,7 @@ pipe_is_readable (struct pipe *pipe, int
this operation will return EWOULDBLOCK instead of blocking when no data is
immediately available. If DATA_ONLY is true, then `control' packets are
ignored. */
-PIPE_EI error_t
+__extern_inline error_t
pipe_wait_readable (struct pipe *pipe, int noblock, int data_only)
{
while (! pipe_is_readable (pipe, data_only) && ! (pipe->flags & PIPE_BROKEN))
@@ -160,7 +172,7 @@ pipe_wait_readable (struct pipe *pipe, i
returns once threads waiting using pipe_wait_readable have been woken and
given a chance to read, and if there is still data available thereafter.
If DATA_ONLY is true, then `control' packets are ignored. */
-PIPE_EI error_t
+__extern_inline error_t
pipe_select_readable (struct pipe *pipe, int data_only)
{
while (! pipe_is_readable (pipe, data_only) && ! (pipe->flags & PIPE_BROKEN))
@@ -172,7 +184,7 @@ pipe_select_readable (struct pipe *pipe,
/* Block until data can be written to PIPE. If NOBLOCK is true, then
EWOULDBLOCK is returned instead of blocking if this can't be done
immediately. */
-PIPE_EI error_t
+__extern_inline error_t
pipe_wait_writable (struct pipe *pipe, int noblock)
{
size_t limit = pipe->write_limit;
@@ -193,7 +205,7 @@ pipe_wait_writable (struct pipe *pipe, i
/* Block until some data can be written to PIPE. This call only returns once
threads waiting using pipe_wait_writable have been woken and given a
chance to write, and if there is still space available thereafter. */
-PIPE_EI error_t
+__extern_inline error_t
pipe_select_writable (struct pipe *pipe)
{
size_t limit = pipe->write_limit;
@@ -203,6 +215,8 @@ pipe_select_writable (struct pipe *pipe)
return 0;
}
+# endif /* Use extern inlines. */
+
/* Creates a new pipe of class CLASS and returns it in RESULT. */
error_t pipe_create (struct pipe_class *class, struct pipe **pipe);
@@ -223,8 +237,28 @@ void _pipe_no_readers (struct pipe *pipe
should be locked. */
void _pipe_no_writers (struct pipe *pipe);
+extern void pipe_acquire_reader (struct pipe *pipe);
+
+extern void pipe_acquire_writer (struct pipe *pipe);
+
+extern void pipe_release_reader (struct pipe *pipe);
+
+extern void pipe_release_writer (struct pipe *pipe);
+
+extern void pipe_add_reader (struct pipe *pipe);
+
+extern void pipe_add_writer (struct pipe *pipe);
+
+extern void pipe_remove_reader (struct pipe *pipe);
+
+extern void pipe_remove_writer (struct pipe *pipe);
+
+extern void pipe_drain (struct pipe *pipe);
+
+# ifdef __USE_EXTERN_INLINES
+
/* Lock PIPE and increment its readers count. */
-PIPE_EI void
+__extern_inline void
pipe_acquire_reader (struct pipe *pipe)
{
mutex_lock (&pipe->lock);
@@ -233,7 +267,7 @@ pipe_acquire_reader (struct pipe *pipe)
}
/* Lock PIPE and increment its writers count. */
-PIPE_EI void
+__extern_inline void
pipe_acquire_writer (struct pipe *pipe)
{
mutex_lock (&pipe->lock);
@@ -243,7 +277,7 @@ pipe_acquire_writer (struct pipe *pipe)
/* Decrement PIPE's (which should be locked) reader count and unlock it. If
there are no more refs to PIPE, it will be destroyed. */
-PIPE_EI void
+__extern_inline void
pipe_release_reader (struct pipe *pipe)
{
if (--pipe->readers == 0)
@@ -254,7 +288,7 @@ pipe_release_reader (struct pipe *pipe)
/* Decrement PIPE's (which should be locked) writer count and unlock it. If
there are no more refs to PIPE, it will be destroyed. */
-PIPE_EI void
+__extern_inline void
pipe_release_writer (struct pipe *pipe)
{
if (--pipe->writers == 0)
@@ -264,7 +298,7 @@ pipe_release_writer (struct pipe *pipe)
}
/* Increment PIPE's reader count. PIPE should be unlocked. */
-PIPE_EI void
+__extern_inline void
pipe_add_reader (struct pipe *pipe)
{
pipe_acquire_reader (pipe);
@@ -272,7 +306,7 @@ pipe_add_reader (struct pipe *pipe)
}
/* Increment PIPE's writer count. PIPE should be unlocked. */
-PIPE_EI void
+__extern_inline void
pipe_add_writer (struct pipe *pipe)
{
pipe_acquire_writer (pipe);
@@ -281,7 +315,7 @@ pipe_add_writer (struct pipe *pipe)
/* Decrement PIPE's (which should be unlocked) reader count and unlock it. If
there are no more refs to PIPE, it will be destroyed. */
-PIPE_EI void
+__extern_inline void
pipe_remove_reader (struct pipe *pipe)
{
mutex_lock (&pipe->lock);
@@ -290,7 +324,7 @@ pipe_remove_reader (struct pipe *pipe)
/* Decrement PIPE's (which should be unlocked) writer count and unlock it. If
there are no more refs to PIPE, it will be destroyed. */
-PIPE_EI void
+__extern_inline void
pipe_remove_writer (struct pipe *pipe)
{
mutex_lock (&pipe->lock);
@@ -298,12 +332,14 @@ pipe_remove_writer (struct pipe *pipe)
}
/* Empty out PIPE of any data. PIPE should be locked. */
-PIPE_EI void
+__extern_inline void
pipe_drain (struct pipe *pipe)
{
pq_drain (pipe->queue);
}
+# endif /* Use extern inlines. */
+
/* Writes up to LEN bytes of DATA, to PIPE, which should be locked, and
returns the amount written in AMOUNT. If present, the information in
CONTROL & PORTS is written in a preceding control packet. If an error is
--- a/libpipe/pq.h
+++ b/libpipe/pq.h
@@ -25,10 +25,7 @@
#include <stddef.h> /* for size_t */
#include <string.h>
#include <mach/mach.h>
-
-#ifndef PQ_EI
-#define PQ_EI extern inline
-#endif
+#include <features.h>
struct packet
@@ -70,13 +67,19 @@ error_t packet_set_ports (struct packet
/* If PACKET has any ports, deallocates them. */
void packet_dealloc_ports (struct packet *packet);
+extern size_t packet_readable (struct packet *packet);
+
+# ifdef __USE_EXTERN_INLINES
+
/* Returns the number of bytes of data in PACKET. */
-PQ_EI size_t
+__extern_inline size_t
packet_readable (struct packet *packet)
{
return packet->buf_end - packet->buf_start;
}
+# endif /* Use extern inlines. */
+
/* Append the bytes in DATA, of length DATA_LEN, to what's already in PACKET,
and return the amount appended in AMOUNT if that's not the null pointer. */
error_t packet_write (struct packet *packet,
@@ -94,14 +97,20 @@ error_t packet_read (struct packet *pack
error_t packet_read_ports (struct packet *packet,
mach_port_t **ports, size_t *num_ports);
+extern void packet_read_source (struct packet *packet, void **source);
+
+# ifdef __USE_EXTERN_INLINES
+
/* Return the source addressd in PACKET in SOURCE, deallocating it from
PACKET. */
-PQ_EI void
+__extern_inline void
packet_read_source (struct packet *packet, void **source)
{
*source = packet->source;
packet->source = 0;
}
+
+# endif /* Use extern inlines. */
/* The packet size above which we start to do things differently to avoid
copying around data. */
@@ -125,9 +134,17 @@ int packet_extend (struct packet *packet
returned. */
error_t packet_realloc (struct packet *packet, size_t new_len);
+extern int packet_fit (struct packet *packet, size_t amount);
+
+extern error_t packet_ensure (struct packet *packet, size_t amount);
+
+extern int packet_ensure_efficiently (struct packet *packet, size_t amount);
+
+# ifdef __USE_EXTERN_INLINES
+
/* Try to make space in PACKET for AMOUNT more bytes without growing the
buffer, returning true if we could do it. */
-PQ_EI int
+__extern_inline int
packet_fit (struct packet *packet, size_t amount)
{
char *buf = packet->buf, *end = packet->buf_end;
@@ -159,7 +176,7 @@ packet_fit (struct packet *packet, size_
/* Make sure that PACKET has room for at least AMOUNT more bytes, or return
the reason why not. */
-PQ_EI error_t
+__extern_inline error_t
packet_ensure (struct packet *packet, size_t amount)
{
if (! packet_fit (packet, amount))
@@ -176,7 +193,7 @@ packet_ensure (struct packet *packet, si
it can be done efficiently, e.g., the packet can be grown in place, rather
than moving the contents (or there is little enough data so that copying
it is OK). True is returned if room was made, false otherwise. */
-PQ_EI int
+__extern_inline int
packet_ensure_efficiently (struct packet *packet, size_t amount)
{
if (! packet_fit (packet, amount))
@@ -189,6 +206,8 @@ packet_ensure_efficiently (struct packet
}
return 0;
}
+
+# endif /* Use extern inlines. */
struct pq
{
@@ -201,10 +220,14 @@ struct pq
the packet, or deallocated by calling pipe_dealloc_addr. */
struct packet *pq_queue (struct pq *pq, unsigned type, void *source);
+extern struct packet * pq_tail (struct pq *pq, unsigned type, void *source);
+
+# ifdef __USE_EXTERN_INLINES
+
/* Returns the tail of the packet queue PQ, which may mean pushing a new
packet if TYPE and SOURCE do not match the current tail, or this is the
first packet. */
-PQ_EI struct packet *
+__extern_inline struct packet *
pq_tail (struct pq *pq, unsigned type, void *source)
{
struct packet *tail = pq->tail;
@@ -214,16 +237,24 @@ pq_tail (struct pq *pq, unsigned type, v
return tail;
}
+# endif /* Use extern inlines. */
+
/* Remove the first packet (if any) in PQ, deallocating any resources it
holds. True is returned if a packet was found, false otherwise. */
int pq_dequeue (struct pq *pq);
+extern struct packet * pq_head (struct pq *pq, unsigned type, void *source);
+
+extern struct packet * pq_next (struct pq *pq, unsigned type, void *source);
+
+# ifdef __USE_EXTERN_INLINES
+
/* Returns the next available packet in PQ, without removing it from the
queue, or NULL if there is none, or the next packet isn't appropiate.
A packet is inappropiate if SOURCE is non-NULL its source field doesn't
match it, or TYPE is non-NULL and the packet's type field doesn't match
it. */
-PQ_EI struct packet *
+__extern_inline struct packet *
pq_head (struct pq *pq, unsigned type, void *source)
{
struct packet *head = pq->head;
@@ -237,7 +268,7 @@ pq_head (struct pq *pq, unsigned type, v
}
/* The same as pq_head, but first discards the head of the queue. */
-PQ_EI struct packet *
+__extern_inline struct packet *
pq_next (struct pq *pq, unsigned type, void *source)
{
if (!pq->head)
@@ -246,6 +277,8 @@ pq_next (struct pq *pq, unsigned type, v
return pq_head (pq, type, source);
}
+# endif /* Use extern inlines. */
+
/* Dequeues all packets in PQ. */
void pq_drain (struct pq *pq);
--- a/libshouldbeinlibc/idvec.h
+++ b/libshouldbeinlibc/idvec.h
@@ -24,10 +24,7 @@
#include <hurd/hurd_types.h>
#include <errno.h>
#include <string.h>
-
-#ifndef IDVEC_EI
-#define IDVEC_EI extern inline
-#endif
+#include <features.h>
struct idvec
{
@@ -50,22 +47,30 @@ void idvec_free_wrapper (struct idvec *i
/* Free IDVEC and any storage associated with it. */
void idvec_free (struct idvec *idvec);
+extern void idvec_clear (struct idvec *idvec);
+
+extern int idvec_is_empty (const struct idvec *idvec);
+
+extern int idvec_equal (const struct idvec *idvec1, const struct idvec *idvec2);
+
+# ifdef __USE_EXTERN_INLINES
+
/* Mark IDVEC as not containing any ids. */
-IDVEC_EI void
+__extern_inline void
idvec_clear (struct idvec *idvec)
{
idvec->num = 0;
}
/* Returns true if IDVEC contains no ids. */
-IDVEC_EI int
+__extern_inline int
idvec_is_empty (const struct idvec *idvec)
{
return idvec->num == 0;
}
/* Return true if IDVEC1 has contents identical to IDVEC2. */
-IDVEC_EI int
+__extern_inline int
idvec_equal (const struct idvec *idvec1, const struct idvec *idvec2)
{
size_t num = idvec1->num;
@@ -74,6 +79,8 @@ idvec_equal (const struct idvec *idvec1,
|| memcmp (idvec1->ids, idvec2->ids, num * sizeof *idvec1->ids) == 0);
}
+# endif /* Use extern inlines. */
+
/* Ensure that IDVEC has enough spaced allocated to hold NUM ids, thus
ensuring that any subsequent ids added won't return a memory allocation
error unless it would result in more ids that NUM. ENOMEM is returned if
@@ -87,13 +94,19 @@ error_t idvec_grow (struct idvec *idvec,
/* Returns true if IDVEC contains ID, at or after position POS. */
int idvec_tail_contains (const struct idvec *idvec, unsigned pos, uid_t id);
+extern int idvec_contains (const struct idvec *idvec, uid_t id);
+
+# ifdef __USE_EXTERN_INLINES
+
/* Returns true if IDVEC contains ID. */
-IDVEC_EI int
+__extern_inline int
idvec_contains (const struct idvec *idvec, uid_t id)
{
return idvec_tail_contains (idvec, 0, id);
}
+# endif /* Use extern inlines. */
+
/* Insert ID into IDVEC at position POS, returning ENOMEM if there wasn't
enough memory, or 0. */
error_t idvec_insert (struct idvec *idvec, unsigned pos, uid_t id);
--- a/libshouldbeinlibc/maptime.h
+++ b/libshouldbeinlibc/maptime.h
@@ -21,13 +21,10 @@
#ifndef __MAPTIME_H__
#define __MAPTIME_H__
-#ifndef MAPTIME_EI
-#define MAPTIME_EI extern inline
-#endif
-
#include <mach/time_value.h>
#include <sys/time.h>
#include <errno.h>
+#include <features.h>
/* Return the mach mapped time page in MTIME. If USE_MACH_DEV is false, then
the hurd time device DEV_NAME, or "/dev/time" if DEV_NAME is 0, is
@@ -37,8 +34,12 @@
error_t maptime_map (int use_mach_dev, char *dev_name,
volatile struct mapped_time_value **mtime);
+extern void maptime_read (volatile struct mapped_time_value *mtime, struct timeval *tv);
+
+# ifdef __USE_EXTERN_INLINES
+
/* Read the current time from MTIME into TV. This should be very fast. */
-MAPTIME_EI void
+__extern_inline void
maptime_read (volatile struct mapped_time_value *mtime, struct timeval *tv)
{
do
@@ -49,4 +50,6 @@ maptime_read (volatile struct mapped_tim
while (tv->tv_sec != mtime->check_seconds);
}
+# endif /* Use extern inlines. */
+
#endif /* __MAPTIME_H__ */
--- a/libshouldbeinlibc/ugids.h
+++ b/libshouldbeinlibc/ugids.h
@@ -23,10 +23,7 @@
#include <stdlib.h> /* For inline function stuff. */
#include <idvec.h>
-
-#ifndef UGIDS_EI
-#define UGIDS_EI extern inline
-#endif
+#include <features.h>
/* A structure holding a set of the common various types of ids. */
struct ugids
@@ -47,8 +44,18 @@ struct ugids
/* Return a new ugids structure, or 0 if an allocation error occurs. */
struct ugids *make_ugids ();
+extern void ugids_fini (struct ugids *ugids);
+
+extern void ugids_free (struct ugids *ugids);
+
+extern int ugids_is_empty (const struct ugids *ugids);
+
+extern int ugids_equal (const struct ugids *ugids1, const struct ugids *ugids2);
+
+# ifdef __USE_EXTERN_INLINES
+
/* Free all resources used by UGIDS except UGIDS itself. */
-UGIDS_EI void
+__extern_inline void
ugids_fini (struct ugids *ugids)
{
idvec_fini (&ugids->eff_uids);
@@ -60,7 +67,7 @@ ugids_fini (struct ugids *ugids)
}
/* Free all resources used by UGIDS. */
-UGIDS_EI void
+__extern_inline void
ugids_free (struct ugids *ugids)
{
ugids_fini (ugids);
@@ -68,7 +75,7 @@ ugids_free (struct ugids *ugids)
}
/* Return true if UGIDS contains no ids. */
-UGIDS_EI int
+__extern_inline int
ugids_is_empty (const struct ugids *ugids)
{
/* We needn't test the imp_*_gids vectors because they are subsets of the
@@ -81,7 +88,7 @@ ugids_is_empty (const struct ugids *ugid
}
/* Free all resources used by UGIDS except UGIDS itself. */
-UGIDS_EI int
+__extern_inline int
ugids_equal (const struct ugids *ugids1, const struct ugids *ugids2)
{
return
@@ -93,6 +100,8 @@ ugids_equal (const struct ugids *ugids1,
&& idvec_equal (&ugids1->imp_avail_gids, &ugids2->imp_avail_gids);
}
+# endif /* Use extern inlines. */
+
/* Add all ids in NEW to UGIDS. */
error_t ugids_merge (struct ugids *ugids, const struct ugids *new);
--- a/libstore/store.h
+++ b/libstore/store.h
@@ -33,10 +33,7 @@
#include <mach.h>
#include <device/device.h>
#include <hurd/hurd_types.h>
-
-#ifndef STORE_EI
-#define STORE_EI extern inline
-#endif
+#include <features.h>
/* Type for addresses inside the store. */
@@ -270,9 +267,13 @@ error_t store_set_child_flags (struct st
STORE's flags. */
error_t store_clear_child_flags (struct store *store, int flags);
+extern int store_is_securely_returnable (struct store *store, int open_flags);
+
+# ifdef __USE_EXTERN_INLINES
+
/* Returns true if STORE can safely be returned to a user who has accessed it
via a node using OPEN_FLAGS, without compromising security. */
-STORE_EI int
+__extern_inline int
store_is_securely_returnable (struct store *store, int open_flags)
{
int flags = store->flags;
@@ -283,6 +284,8 @@ store_is_securely_returnable (struct sto
|| (flags & STORE_HARD_READONLY)));
}
+# endif /* Use extern inlines. */
+
/* Fills in the values of the various fields in STORE that are derivable from
the set of runs & the block size. */
void _store_derive (struct store *store);
--- a/libthreads/rwlock.h
+++ b/libthreads/rwlock.h
@@ -21,6 +21,7 @@
#include <cthreads.h>
#include <assert.h>
+#include <features.h>
struct rwlock
{
@@ -31,12 +32,20 @@ struct rwlock
int readers_waiting;
};
-#ifndef RWLOCK_EI
-#define RWLOCK_EI extern inline
-#endif
+extern void rwlock_reader_lock (struct rwlock *lock);
+
+extern void rwlock_writer_lock (struct rwlock *lock);
+
+extern void rwlock_reader_unlock (struct rwlock *lock);
+
+extern void rwlock_writer_unlock (struct rwlock *lock);
+
+extern void rwlock_init (struct rwlock *lock);
+
+# ifdef __USE_EXTERN_INLINES
/* Get a reader lock on reader-writer lock LOCK for disknode DN */
-RWLOCK_EI void
+__extern_inline void
rwlock_reader_lock (struct rwlock *lock)
{
mutex_lock (&lock->master);
@@ -53,7 +62,7 @@ rwlock_reader_lock (struct rwlock *lock)
}
/* Get a writer lock on reader-writer lock LOCK for disknode DN */
-RWLOCK_EI void
+__extern_inline void
rwlock_writer_lock (struct rwlock *lock)
{
mutex_lock (&lock->master);
@@ -70,7 +79,7 @@ rwlock_writer_lock (struct rwlock *lock)
}
/* Release a reader lock on reader-writer lock LOCK for disknode DN */
-RWLOCK_EI void
+__extern_inline void
rwlock_reader_unlock (struct rwlock *lock)
{
mutex_lock (&lock->master);
@@ -82,7 +91,7 @@ rwlock_reader_unlock (struct rwlock *loc
}
/* Release a writer lock on reader-writer lock LOCK for disknode DN */
-RWLOCK_EI void
+__extern_inline void
rwlock_writer_unlock (struct rwlock *lock)
{
mutex_lock (&lock->master);
@@ -94,7 +103,7 @@ rwlock_writer_unlock (struct rwlock *loc
}
/* Initialize reader-writer lock LOCK */
-RWLOCK_EI void
+__extern_inline void
rwlock_init (struct rwlock *lock)
{
mutex_init (&lock->master);
@@ -104,6 +113,8 @@ rwlock_init (struct rwlock *lock)
lock->writers_waiting = 0;
}
+# endif /* Use extern inlines. */
+
#define RWLOCK_INITIALIZER \
{ MUTEX_INITIALIZER, CONDITION_INITIALIZER, 0, 0, 0 }
|