mailing list of musl libc
 help / color / mirror / code / Atom feed
From: John Mudd <johnbmudd@gmail.com>
To: musl <musl@lists.openwall.com>
Cc: John Mudd <johnbmudd@gmail.com>
Subject: posix_fallocate() fails on some machines
Date: Thu, 26 Apr 2018 15:54:19 -0400	[thread overview]
Message-ID: <CAGDMk9Fo05xj-Wof6gj-hOO1fuRaQdfurpxguxYppF983mP_kQ@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 828 bytes --]

I built a 32-bit dynamically linked Postgres using musl but I can't run on
some machines because posix_fallocate() returns 95, "not supported".

Here's a sample program that reproduces the issue even when compiled
statically. Any suggestions?

# Build a 32-bit static executable. Works.
$ cat test_posix_fallocate.c
#include <stdio.h>
#include <fcntl.h>
int main() {
    int fd = open("foo", O_RDWR|O_CREAT, 0666);
    if (fd < 0) return 1;
    printf("posix_fallocate() returned %d\n", posix_fallocate(fd, 0,
400000));
}
$
$ uname -mrs
Linux 4.4.0-116-generic i686
$ musl-gcc -static -o test_posix_fallocate test_posix_fallocate.c
$ test_posix_fallocate
posix_fallocate() returned 0
$

# Copy it to an older OS. Fails.
$ uname -mrs
Linux 2.6.32-358.14.1.el6.x86_64 x86_64
$ test_posix_fallocate
posix_fallocate() returned 95
$

[-- Attachment #2: Type: text/html, Size: 1233 bytes --]

             reply	other threads:[~2018-04-26 19:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-26 19:54 John Mudd [this message]
2018-04-26 20:08 ` Rich Felker
2018-04-26 20:21   ` John Mudd
2018-04-26 20:52     ` Rich Felker
2018-04-27 20:01       ` John Mudd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGDMk9Fo05xj-Wof6gj-hOO1fuRaQdfurpxguxYppF983mP_kQ@mail.gmail.com \
    --to=johnbmudd@gmail.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).