Update GIT documentation to describe the new DAC setup
[zfs.git] / patches / port-pragma-init.patch
1 Use constructor attribute on non-Solaris platforms.
2
3 Index: zfs+chaos4/lib/libuutil/uu_misc.c
4 ===================================================================
5 --- zfs+chaos4.orig/lib/libuutil/uu_misc.c
6 +++ zfs+chaos4/lib/libuutil/uu_misc.c
7 @@ -251,7 +251,13 @@ uu_release_child(void)
8         uu_release();
9  }
10  
11 +#ifdef __GNUC__
12 +static void
13 +uu_init(void) __attribute__((constructor));
14 +#else
15  #pragma init(uu_init)
16 +#endif
17 +
18  static void
19  uu_init(void)
20  {
21 Index: zfs+chaos4/lib/libzfs/libzfs_mount.c
22 ===================================================================
23 --- zfs+chaos4.orig/lib/libzfs/libzfs_mount.c
24 +++ zfs+chaos4/lib/libzfs/libzfs_mount.c
25 @@ -128,7 +128,13 @@ zfs_share_proto_t share_all_proto[] = {
26         PROTO_END
27  };
28  
29 +#ifdef __GNUC__
30 +static void
31 +zfs_iscsi_init(void) __attribute__((constructor));
32 +#else
33  #pragma init(zfs_iscsi_init)
34 +#endif
35 +
36  static void
37  zfs_iscsi_init(void)
38  {
39 @@ -548,8 +554,12 @@ static void (*_sa_update_sharetab_ts)(sa
40   * values to be used later. This is triggered by the runtime loader.
41   * Make sure the correct ISA version is loaded.
42   */
43 -
44 +#ifdef __GNUC__
45 +static void
46 +_zfs_init_libshare(void) __attribute__((constructor));
47 +#else
48  #pragma init(_zfs_init_libshare)
49 +#endif
50  static void
51  _zfs_init_libshare(void)
52  {