<feed xmlns='http://www.w3.org/2005/Atom'>
<title>libgpg-error/src/posix-lock.c, branch libgpg-error-1.15</title>
<subtitle>Error codes used by GnuPG et al.</subtitle>
<id>http://git.bktus.com/gpgfrontend/libgpg-error/atom?h=libgpg-error-1.15</id>
<link rel='self' href='http://git.bktus.com/gpgfrontend/libgpg-error/atom?h=libgpg-error-1.15'/>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/libgpg-error/'/>
<updated>2014-08-25T14:37:46Z</updated>
<entry>
<title>Replace locking code in estream functions.</title>
<updated>2014-08-25T14:37:46Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2014-08-25T14:33:09Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/libgpg-error/commit/?id=fc651665010056e6184e8514e5c5436427d7052d'/>
<id>urn:sha1:fc651665010056e6184e8514e5c5436427d7052d</id>
<content type='text'>
* src/posix-lock.c: Add weak program for pthread_mutex_trylock.
(_gpgrt_lock_trylock): New.
* src/w32-lock.c (_gpgrt_lock_init): Add missing return statement.
(_gpgrt_lock_trylock): New.
* src/visibility.c (gpgrt_set_syscall_clamp): New.
(gpgrt_lock_trylock): New.
(gpgrt_vsnprintf): Fix symbol name.
* src/init.c (DllMain): Mark unused arg.
* src/estream.c: Replace npth mutexes by our own locks.  Replace yeild
macro by _gpgrt_yield.
(pre_syscall_func, post_syscall_func): New.
(do_deinit): Clear both new vars.
(es_func_fd_read, es_func_fd_write): Call pre and post syscall
functions instead of the former SYSCALL macros.
(es_func_w32_read, es_func_w32_write): Ditto.
(es_func_fd_seek, es_func_w32_seek, es_func_fp_read)
(es_func_fp_write, es_func_fp_seek, es_func_fp_destroy): Bracket
syscalls with the pre- and post-syscall fucntions.
(do_npth_read, do_npth_write): Remove.
(_gpgrt_es_init): Remove call to mutex init.  It is now statically
initialized.
(_gpgrt_set_syscall_clamp): New.
(es_create): Destroy stream lock on error.
(do_close): Destroy stream lock.
</content>
</entry>
<entry>
<title>Implement symbol visibility.</title>
<updated>2014-08-25T14:37:46Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2014-08-22T17:08:08Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/libgpg-error/commit/?id=216e7def2118a1774fa7ebeb45b8635b9fe6ba42'/>
<id>urn:sha1:216e7def2118a1774fa7ebeb45b8635b9fe6ba42</id>
<content type='text'>
* configure.ac: New option --enable-ld-version-script.
(GPGRT_USE_VISIBILITY): New ac_define.
(HAVE_LD_VERSION_SCRIPT): New am_conditional.
* src/gpg-error.vers: New.
* src/gpgrt-int.h: New.
* src/visibility.c, src/visibility.h: New.  Lot of changes to symbold
names.
--

This is only doe for the old API.  The estream API needs to be added.
</content>
</entry>
<entry>
<title>Allow using gpgrt_lock_init on an unitialized variable.</title>
<updated>2014-01-24T15:29:33Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2014-01-09T18:14:09Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/libgpg-error/commit/?id=4e8a88e7632b1f1d2b31ae738a159802549882c3'/>
<id>urn:sha1:4e8a88e7632b1f1d2b31ae738a159802549882c3</id>
<content type='text'>
* src/posix-lock.c (gpgrt_lock_init): Detect unitialized lock var.
* src/w32-lock.c (gpgrt_lock_init): Ditto.
--

gpgrt_lock_init may be used for dynamically allocated locks.  For
example

   gpgrt_lock_t *lock = xcalloc (1, sizeof *lock);
   gpgrt_lock_init (lock);
   gpgrt_lock_lock (lock);
   foo ();
   gpgrt_lock_unlock (lock);
   gpgrt_lock_destroy (lock);
   free (lock);

This patch actually allows for this.

Signed-off-by: Werner Koch &lt;wk@gnupg.org&gt;
</content>
</entry>
<entry>
<title>Move version number first in the Posix lock-obj.</title>
<updated>2014-01-17T17:06:37Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2014-01-09T18:14:09Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/libgpg-error/commit/?id=e07538c0ed3c5cb3d870a490a4c12bef4375278a'/>
<id>urn:sha1:e07538c0ed3c5cb3d870a490a4c12bef4375278a</id>
<content type='text'>
* src/posix-lock-obj.h (_gpgrt_lock_t): Swap VERS and MTX and put MTX
into a union.
* src/posix-lock.c (gpgrt_lock_lock): Adjust for this change.
* src/gen-posix-lock-obj.c (main): Change output accordingly.

Signed-off-by: Werner Koch &lt;wk@gnupg.org&gt;
</content>
</entry>
<entry>
<title>Add gpgrt_lock_ functions.</title>
<updated>2014-01-16T08:58:22Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2014-01-09T18:14:09Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/libgpg-error/commit/?id=ff937c39febe63d52c55590d8e3bd3a460f26651'/>
<id>urn:sha1:ff937c39febe63d52c55590d8e3bd3a460f26651</id>
<content type='text'>
* src/gpg-error.h.in (GPGRT_LOCK_DEFINE): New.
(gpgrt_lock_init): New.
(gpgrt_lock_lock): New.
(gpgrt_lock_unlock): New.
(gpgrt_lock_destroy): New.
(gpgrt_yield): New.
* src/gpg-error.def.in: Add new functions.
* m4/lock.m4, m4/threadlib.m4: New. Taken from current gnulib.
* configure.ac: Call gl_LOCK.  Check size of pthread_mutex_t. Add
LIBTHREAD to GPG_ERROR_CONFIG_LIBS.
* src/err-codes.h.in (GPG_ERR_INV_LOCK_OBJ): New.
* src/gen-posix-lock-obj.c: New.
* src/gen-w32-lock-obj.c: New.
* src/lock.h, src/thread.h: New.
* src/posix-lock-obj.h, src/w32-lock-obj.h: New.
* src/posix-lock.c, src/w32-lock.c: New.
* src/posix-thread.c, src/w32-thread.c:
* src/w32-lock-obj-pub.in: New.
* src/mkheader.c (include_file): Support build time include files.
(write_special): Add keyword "include:lock-obj".
* src/Makefile.am:
(posix-lock-obj-pub.in): New rule.
(noinst_PROGRAMS): Add gen-*-lock-obj helpers.

* tests/t-common.h: New.
* tests/t-lock.c: New.
* tests/Makefile.am (t_lock_LDADD): Add new test.

--

This patch introduces the gpgrt_ functions which will be extended over
time to provide a library of commonly used code in GnuPG and
Libgcrypt.  Having them in a library named libgpg-error is a misnomer
but this way we can achieve a smooth upgrade path.

In contrasts to other GnuPG libraries, the gpgrt_ functions return a
simple gpg_err_code_t and not gpg_error_t.  The rationale for this is
that a source of error identifier does not make sense here; it is
better to use the source of error identifier of the caller.  This can
easily be achieved in a component by wrapping these function in a
gpg_error macro/inline.

There is no cross-compiling support for Posix platforms; the
gen-posix-lock-obj tool must be run on the target system.

Note that the gen-w32-lock-obj tool is not needed at build time but
was used to figure out ABI definitions for Windows.

Signed-off-by: Werner Koch &lt;wk@gnupg.org&gt;
</content>
</entry>
</feed>
