diff options
author | William Pitcock <nenolod@dereferenced.org> | 2017-11-16 05:50:10 +0000 |
---|---|---|
committer | William Pitcock <nenolod@dereferenced.org> | 2017-11-16 05:50:10 +0000 |
commit | bf0205104ba520e7d2fea17704a1cc131551c3d3 (patch) | |
tree | 6f3d03abbe0934703f431ac4b3d287bde7b3037b /main | |
parent | affa8e396bcfc542aae2c8cedf19d08588dbc507 (diff) | |
download | aports-bf0205104ba520e7d2fea17704a1cc131551c3d3.tar.bz2 aports-bf0205104ba520e7d2fea17704a1cc131551c3d3.tar.xz |
main/musl: add GNU typedefs for fopencookie hook functions
Diffstat (limited to 'main')
-rw-r--r-- | main/musl/3002-stdio-implement-fopencookie-3.patch | 30 | ||||
-rw-r--r-- | main/musl/APKBUILD | 4 |
2 files changed, 21 insertions, 13 deletions
diff --git a/main/musl/3002-stdio-implement-fopencookie-3.patch b/main/musl/3002-stdio-implement-fopencookie-3.patch index 0c5eb63878..4b863e9095 100644 --- a/main/musl/3002-stdio-implement-fopencookie-3.patch +++ b/main/musl/3002-stdio-implement-fopencookie-3.patch @@ -1,7 +1,7 @@ -From b0949ba08f7b896593eaf27023a16a0f26c9ed14 Mon Sep 17 00:00:00 2001 +From 1f6d9870ebc905990d230a3887d2e91a9edfde93 Mon Sep 17 00:00:00 2001 From: William Pitcock <nenolod@dereferenced.org> Date: Sun, 24 Sep 2017 16:37:48 -0500 -Subject: [PATCH 30/30] stdio: implement fopencookie(3) +Subject: [PATCH] stdio: implement fopencookie(3) The fopencookie(3) function allows the programmer to create a custom stdio implementation, using four hook functions which operate on a @@ -9,6 +9,9 @@ stdio implementation, using four hook functions which operate on a Changelog: +v7: +- include GNU typedefs for cookie i/o functions + v6: - remove pointer arithmetic instead using a structure to contain the parent FILE object @@ -34,25 +37,30 @@ v2: v1: - initial proof of concept --- - include/stdio.h | 9 ++++ + include/stdio.h | 14 +++++ src/stdio/fopencookie.c | 141 ++++++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 150 insertions(+) + 2 files changed, 155 insertions(+) create mode 100644 src/stdio/fopencookie.c diff --git a/include/stdio.h b/include/stdio.h -index 884d2e6a..da0563f6 100644 +index 884d2e6a..2932c76f 100644 --- a/include/stdio.h +++ b/include/stdio.h -@@ -182,6 +182,15 @@ int vasprintf(char **, const char *, __isoc_va_list); +@@ -182,6 +182,20 @@ int vasprintf(char **, const char *, __isoc_va_list); #ifdef _GNU_SOURCE char *fgets_unlocked(char *, int, FILE *); int fputs_unlocked(const char *, FILE *); + ++typedef ssize_t (cookie_read_function_t)(void *, char *, size_t); ++typedef ssize_t (cookie_write_function_t)(void *, const char *, size_t); ++typedef int (cookie_seek_function_t)(void *, off_t *, int); ++typedef int (cookie_close_function_t)(void *); ++ +typedef struct { -+ ssize_t (*read)(void *, char *, size_t); -+ ssize_t (*write)(void *, const char *, size_t); -+ int (*seek)(void *, off_t *, int); -+ int (*close)(void *); ++ cookie_read_function_t *read; ++ cookie_write_function_t *write; ++ cookie_seek_function_t *seek; ++ cookie_close_function_t *close; +} cookie_io_functions_t; + +FILE *fopencookie(void *, const char *, cookie_io_functions_t); @@ -207,5 +215,5 @@ index 00000000..bcf42c10 + return __ofl_add(&f->f); +} -- -2.13.3 +2.15.0 diff --git a/main/musl/APKBUILD b/main/musl/APKBUILD index 81059f4fad..8370169012 100644 --- a/main/musl/APKBUILD +++ b/main/musl/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Timo Teräs <timo.teras@iki.fi> pkgname=musl pkgver=1.1.18 -pkgrel=0 +pkgrel=1 pkgdesc="the musl c library (libc) implementation" url="http://www.musl-libc.org/" arch="all" @@ -145,7 +145,7 @@ compat() { sha512sums="4d55c92efe41dfdd9fff6aca5dda76a632a3be60d10e5a7f66a4731d8f7040fb0a20b998965ba4d069b4f8a3527fcd7388e646cb66afc649c4d0cc6c3d358c9c musl-1.1.18.tar.gz 7e4c703e57a3564cd3ee1d5334b806cbe654355179ba55d4d25361dfc555eb4a7d081d80d64fdaff8476949afd04558d278b124d1fb108080beaa5ba2f8ce2b9 1000-implement-strftime-GNU-extension-padding-specifiers-.patch 2c8e1dde1834238097b2ee8a7bfb53471a0d9cff4a5e38b55f048b567deff1cdd47c170d0578a67b1a039f95a6c5fbb8cff369c75b6a3e4d7ed171e8e86ebb8c 2000-pthread-internals-increase-DEFAULT_GUARD_SIZE-to-2-p.patch -0053e16cbac968b50dee98e3b36d29a497aaca6d9d0e120556273c9d0cd8360310eb7b7ab3c1e416217210fdd071e98268eaca54f3a0e9a22408ed8701dc54c1 3002-stdio-implement-fopencookie-3.patch +30e7fdbdb5fd18d6b2d49b0277ca62d253a52087938b0f4ff75fba278ee3adcaae219043db130f8acd24713a8e2345aceda28d2f6a7d49de2d3ae8fba0eba924 3002-stdio-implement-fopencookie-3.patch 8d3a2d5315fc56fee7da9abb8b89bb38c6046c33d154c10d168fb35bfde6b0cf9f13042a3bceee34daf091bc409d699223735dcf19f382eeee1f6be34154f26f ldconfig 062bb49fa54839010acd4af113e20f7263dde1c8a2ca359b5fb2661ef9ed9d84a0f7c3bc10c25dcfa10bb3c5a4874588dff636ac43d5dbb3d748d75400756d0b __stack_chk_fail_local.c 0d80f37b34a35e3d14b012257c50862dfeb9d2c81139ea2dfa101d981d093b009b9fa450ba27a708ac59377a48626971dfc58e20a3799084a65777a0c32cbc7d getconf.c |