Displaying 20 results from an estimated 47 matches for "get_current_dir_name".
2020 Aug 18
0
[PATCH nbdkit 6/9] lib: Use replacement strategy for get_current_dir_name.
...on, so use
the same LIBOBJS mechanism to replace it.
---
configure.ac | 2 +-
common/include/Makefile.am | 6 ---
common/replacements/Makefile.am | 10 ++++
plugins/floppy/Makefile.am | 1 +
common/replacements/get_current_dir_name.h | 49 +++++++++++++++++++
server/public.c | 2 +-
.../get_current_dir_name.c} | 10 ++--
.../test-current-dir-name.c | 2 +-
plugins/floppy/virtual-floppy.c | 2 +-
.gitignore...
2020 Aug 18
1
Re: [PATCH nbdkit 6/9] lib: Use replacement strategy for get_current_dir_name.
...sm to replace it.
> ---
> configure.ac | 2 +-
> common/include/Makefile.am | 6 ---
> common/replacements/Makefile.am | 10 ++++
> plugins/floppy/Makefile.am | 1 +
> common/replacements/get_current_dir_name.h | 49 +++++++++++++++++++
> server/public.c | 2 +-
> .../get_current_dir_name.c} | 10 ++--
> .../test-current-dir-name.c | 2 +-
> plugins/floppy/virtual-floppy.c | 2 +-
> .gitignore...
2018 Oct 28
0
[PATCH nbdkit 1/4] common: Move get_current_dir_name(3) compatibility function.
...TS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/* Implement get_current_dir_name(3) on platforms which don't have it. */
+
+#ifndef NBDKIT_GET_CURRENT_DIR_NAME_H
+#define NBDKIT_GET_CURRENT_DIR_NAME_H
+
+#include <config.h>
+
+#ifndef HAVE_GET_CURRENT_DIR_NAME
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <limits.h>
+
+static inline char *
+g...
2018 Aug 12
0
[PATCH nbdkit 05/10] freebsd: Provide alternative for glibc get_current_dir_name function.
...++++++++
2 files changed, 17 insertions(+)
diff --git a/configure.ac b/configure.ac
index 3381955..0b0f233 100644
--- a/configure.ac
+++ b/configure.ac
@@ -138,6 +138,10 @@ AC_CHECK_HEADERS([\
sys/prctl.h \
sys/procctl.h])
+dnl Check for functions in libc, all optional.
+AC_CHECK_FUNCS([\
+ get_current_dir_name])
+
dnl Check support for setsockcreatecon_raw (part of SELinux).
AC_CHECK_LIB([selinux], [setsockcreatecon_raw], [], [:])
diff --git a/src/utils.c b/src/utils.c
index 636e483..0e48d52 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -40,11 +40,24 @@
#include <inttypes.h>
#include <stri...
2019 Jan 14
6
[PATCH nbdkit incomplete 0/5] Port to Windows.
This is an incomplete port to Windows. Currently the server compiles
and starts up successfully, but goes into an infinite loop when you
connect to it. Nevertheless I think the approach is ready for
feedback. This being Windows the changes go quite deep.
Rich.
2015 Dec 02
5
[PATCH] Receive multiple packets at a time
...sing sendmmsg
will again improve performance.
Samuel
--- configure.ac.original 2015-10-02 17:06:31.250034677 +0200
+++ configure.ac 2015-10-02 17:06:54.147546590 +0200
@@ -187,7 +187,7 @@
dnl Checks for library functions.
AC_TYPE_SIGNAL
-AC_CHECK_FUNCS([asprintf daemon fchmod flock ftime fork get_current_dir_name gettimeofday mlockall putenv random select strdup strerror strsignal strtol system time usleep unsetenv vsyslog writev],
+AC_CHECK_FUNCS([asprintf daemon fchmod flock ftime fork get_current_dir_name gettimeofday mlockall putenv random recvmmsg select strdup strerror strsignal strtol system time usl...
2007 Oct 18
0
[PATCH] Use credentials and permissions on control socket where available
...6, struct ip6_hdr, struct icmp6_hdr, struct nd_neighbor_solicit, struct nd_opt_hdr, struct ucred], , ,
[#include "have.h"]
)
@@ -122,7 +122,7 @@ dnl Checks for library functions.
AC_FUNC_MEMCMP
AC_FUNC_ALLOCA
AC_TYPE_SIGNAL
-AC_CHECK_FUNCS([asprintf daemon fchmod flock ftime fork get_current_dir_name gettimeofday mlockall putenv random select strdup strerror strsignal strtol system unsetenv vsyslog writev],
+AC_CHECK_FUNCS([asprintf daemon fchmod flock ftime fork get_current_dir_name getpeereid gettimeofday mlockall putenv random select strdup strerror strsignal strtol system unsetenv vsyslog w...
2020 Aug 18
15
[PATCH nbdkit 0/9] Port to Windows.
Also available here:
https://github.com/rwmjones/nbdkit/tree/2020-windows-mingw
This is the port to Windows using native Windows APIs (not MSYS or
Cygwin).
This patch series is at the point where it basically now works. I can
run the server with the memory plugin, and access it remotely using
guestfish, creating filesystems and so on without any apparent
problems.
Nevertheless there are many
2015 Dec 10
2
[PATCH] Receive multiple packets at a time
...re.ac b/configure.ac
index 5cdd642..fcac9d2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -187,7 +187,7 @@ AC_CHECK_TYPES([socklen_t, struct ether_header, struct arphdr, struct ether_arp,
dnl Checks for library functions.
AC_TYPE_SIGNAL
-AC_CHECK_FUNCS([asprintf daemon fchmod flock ftime fork get_current_dir_name gettimeofday mlockall pselect putenv random select strdup strerror strsignal strtol system unsetenv usleep vsyslog writev],
+AC_CHECK_FUNCS([asprintf daemon fchmod flock ftime fork get_current_dir_name gettimeofday mlockall pselect putenv random recvmmsg select strdup strerror strsignal strtol syst...
2015 Dec 02
0
[PATCH] Receive multiple packets at a time
...uel
>
> --- configure.ac.original 2015-10-02 17:06:31.250034677 +0200
> +++ configure.ac 2015-10-02 17:06:54.147546590 +0200
> @@ -187,7 +187,7 @@
>
> dnl Checks for library functions.
> AC_TYPE_SIGNAL
> -AC_CHECK_FUNCS([asprintf daemon fchmod flock ftime fork get_current_dir_name gettimeofday mlockall putenv random select strdup strerror strsignal strtol system time usleep unsetenv vsyslog writev],
> +AC_CHECK_FUNCS([asprintf daemon fchmod flock ftime fork get_current_dir_name gettimeofday mlockall putenv random recvmmsg select strdup strerror strsignal strtol system tim...
2020 Aug 20
15
[PATCH nbdkit 0/13] Port to Windows without using a separate library.
Also available here:
https://github.com/rwmjones/nbdkit/tree/2020-windows-mingw-nolib
After a lot of work I have made the port to Windows work without using
a separate library. Instead, on Windows only, we build an "import
library" (library of stubs) which resolves references to nbdkit_*
functions in the main program and fixes up the plugin, basically the
first technique outlined in
2020 Mar 26
0
[PATCH nbdkit 5/9 patch split 2/5] lib: Move code for parsing, passwords and paths into libnbdkit.so.
...#39;) {
- nbdkit_error ("cannot convert null or empty path to an absolute path");
- return NULL;
- }
-
- if (*path == '/') {
- ret = strdup (path);
- if (!ret) {
- nbdkit_error ("strdup: %m");
- return NULL;
- }
- return ret;
- }
-
- pwd = get_current_dir_name ();
- if (pwd == NULL) {
- nbdkit_error ("get_current_dir_name: %m");
- return NULL;
- }
-
- if (asprintf (&ret, "%s/%s", pwd, path) == -1) {
- nbdkit_error ("asprintf: %m");
- return NULL;
- }
-
- return ret;
-}
-
-char *
-nbdkit_realpath (const c...
2014 Oct 23
17
[PATCH 00/16] Small bits of non-Linux porting
...string
Include stdint.h where needed
build: use $(SED) instead of sed when possible
tests/c-api: add a way to skip test when host and appliance differ
actions: mark as IfNotCrossAppliance tests of command and
command_lines
customize, mllib: use the libvirt CFLAGS
tests: switch from get_current_dir_name to getcwd(0, NULL)
configure: map also amd64 as host_cpu to x86_64 qemu
bootstrap | 2 ++
builder/index-parse.y | 4 +--
builder/index-parser-c.c | 2 +-
builder/index-struct.h | 2 +-
configure.ac...
2018 Feb 14
0
Re: [nbdkit PATCH v2] plugin: add and use nbdkit_realpath
...et;
> +
> + if (path == NULL || *path == '\0') {
> + nbdkit_error ("cannot resolve a null or empty path");
> + return NULL;
> + }
> +
> + ret = realpath (path, NULL);
Wait. Does this even work? Remember, in nbdkit_absolute_path(), we are
prepending get_current_dir_name() (why the GNU spelling, instead of
getcwd(NULL, 0), since either way is a GNU extension?). But in main.c,
we call an unconditional chdir("/") as part of fork_into_background,
which has the annoying result that when using 'nbdkit -f' you honor your
current $PWD, but when runn...
2019 Aug 02
1
[nbdkit PATCH] server: Restrict thread model when no atomic CLOEXEC
...exes for
+fields in your connection handle.
=back
diff --git a/configure.ac b/configure.ac
index cabec5c8..054ad64a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -193,6 +193,7 @@ AC_CHECK_HEADERS([\
dnl Check for functions in libc, all optional.
AC_CHECK_FUNCS([\
+ accept4 \
fdatasync \
get_current_dir_name \
mkostemp \
diff --git a/common/utils/utils.c b/common/utils/utils.c
index 9ac3443b..029b6685 100644
--- a/common/utils/utils.c
+++ b/common/utils/utils.c
@@ -140,13 +140,15 @@ exit_status_to_nbd_error (int status, const char *cmd)
*/
int
set_cloexec (int fd) {
-#if defined SOCK_CLOEXEC &...
2018 Oct 28
6
[PATCH nbdkit 0/4] Add floppy plugin.
Add nbdkit-floppy-plugin, “inspired” by qemu's VVFAT driver, but
without the ability to handle writes.
The implementation is pretty complete, supporting FAT32, LFNs, volume
labels, timestamps, etc, and it passes both ‘make check’ and ‘make
check-valgrind’.
Usage is simple; to serve the current directory:
$ nbdkit floppy .
Then using guestfish (or any NBD client):
$ guestfish --ro
2012 Dec 13
1
[PATCH] daemon: fix directory outside current root when executing commands
...+
+/* This program, which must be statically linked, is used to test the
+ * guestfs_command and guestfs_command_lines functions.
+ */
+
+#include <config.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+int
+main (int argc, char *argv[])
+{
+ char *cwd = get_current_dir_name();
+ printf("%s", cwd);
+
+ exit (EXIT_SUCCESS);
+}
--
1.7.11.7
2019 Aug 02
0
[nbdkit PATCH v2 07/17] build: Audit for use of pipe2
...+++++++++++++
tests/test-layers.c | 4 +++-
tests/test-streaming.c | 5 +++--
6 files changed, 58 insertions(+), 5 deletions(-)
diff --git a/configure.ac b/configure.ac
index c6bb1b10..cabec5c8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -196,6 +196,7 @@ AC_CHECK_FUNCS([\
fdatasync \
get_current_dir_name \
mkostemp \
+ pipe2 \
posix_fadvise])
dnl Check whether printf("%m") works
diff --git a/common/utils/utils.c b/common/utils/utils.c
index 7b63b4d4..9ac3443b 100644
--- a/common/utils/utils.c
+++ b/common/utils/utils.c
@@ -140,13 +140,13 @@ exit_status_to_nbd_error (int status, cons...
2009 May 15
2
Trouble with Tinc at make level
...memcmp... yes
checking for working alloca.h... yes
checking for alloca... yes
checking return type of signal handlers... void
checking for asprintf... yes
checking for daemon... yes
checking for fchmod... yes
checking for flock... yes
checking for ftime... yes
checking for fork... yes
checking for get_current_dir_name... yes
checking for gettimeofday... yes
checking for mlockall... yes
checking for putenv... yes
checking for random... yes
checking for select... yes
checking for strdup... yes
checking for strerror... yes
checking for strsignal... yes
checking for strtol... yes
checking for system... yes
checking...
2020 Aug 18
0
[PATCH nbdkit 7/9] server: Add hand-written replacement for poll for Windows.
...--- a/server/public.c
+++ b/server/public.c
@@ -47,7 +47,6 @@
#include <limits.h>
#include <termios.h>
#include <errno.h>
-#include <poll.h>
#include <signal.h>
#include <sys/socket.h>
@@ -55,6 +54,7 @@
#include "ascii-string.h"
#include "get_current_dir_name.h"
#include "getline.h"
+#include "poll.h"
#include "realpath.h"
#include "internal.h"
diff --git a/server/sockets.c b/server/sockets.c
index f6c9643a..8da331da 100644
--- a/server/sockets.c
+++ b/server/sockets.c
@@ -38,7 +38,6 @@
#include <int...