Search results

  1. Bill Evans at Mariposa

    Python python fractions module: round() error?

    Duh. Never mind. The documentation plainly says it rounds to even.
  2. Bill Evans at Mariposa

    Python python fractions module: round() error?

    import fractions round(fractions.Fraction("3.5")) yields 4, of course. But round(fractions.Fraction("49886.5")) yields 49886, not 49887. Why is that?
  3. Bill Evans at Mariposa

    C running bare "mount" command in C

    If a C program wants to find out which filesystems are mounted, it can fire up a subprocess, and in that subprocess run the "mount" command without any command line parameters; the parent process can then parse the subprocess's stdout, as one would read the result of typing "mount" on the...
  4. Bill Evans at Mariposa

    #!/usr/bin/env doesn't work for CGI scripts

    Not enough coffee this morning. Sorry. (sigh)
  5. Bill Evans at Mariposa

    #!/usr/bin/env doesn't work for CGI scripts

    When I begin a CGI script with #!/usr/local/bin/python3 it works fine. But when I begin it with #!/usr/bin/env python3 I get 500 Internal Server Error Further investigation shows that the environment variable PATH when running a CGI script is: /sbin:/bin:/usr/sbin:/usr/bin When I run...
  6. Bill Evans at Mariposa

    gimp dependency on python 2.7

    Yeah, I have the same question. If 2021 rolls around and I need to install a new version of FreeBSD, I plan to install gimp from source, from gimp.org/source. If you scroll down that page, you'll notice that there are some dependencies you have to take care of first. Note that Python is not...
  7. Bill Evans at Mariposa

    C ioctl SPKRTONE/SPKRTUNE vs. KIOCSOUND

    On Linux (gag), I can issue this to device /dev/console: ioctl(fd,KIOCSOUND,6087 /* G below middle C */) ... but even though FreeBSD defines the KIOCSOUND ioctl in /usr/include/sys/kbio.h, it seems to return error 25, Inappropriate ioctl for device (and returns the same if the device is...
  8. Bill Evans at Mariposa

    C msgget() w/o IPC_CREAT -> Permission denied (sometimes)

    If you omit IPC_CREAT, then: If the queue does not exist, it fails. (That's a good thing.) If the queue exists, then it works UNLESS msgflg is 0100, as demonstrated in the original post. I then modified the original experiment so that when first creating the queue with IPC_CREAT, the...
  9. Bill Evans at Mariposa

    C msgget() w/o IPC_CREAT -> Permission denied (sometimes)

    Thanks for your response. It turns out that my question is not about the man page, but about the actual behavior under certain circumstances. As I said, "I'm curious about what's going on." EDIT Nonetheless, if we pursue the man page aspect, we have an incomplete man page, not only because...
  10. Bill Evans at Mariposa

    C msgget() w/o IPC_CREAT -> Permission denied (sometimes)

    The workaround for the following problem is trivial, but I'm still curious about what's going on. If you call msgget with a positive key and a zero msgflg, it works as advertised. But if msgflg is octal 0100, you get "Permission denied". No other bit in the final nine bits of the flag makes...
  11. Bill Evans at Mariposa

    C the "a" mode bit in msgget(2)

    If, when creating a message queue using msgget, I set the mode to 0777, and then later use ipcs to list it, the mode is displayed as rwarwarwa. What does the a mean? Also, where could I have found the answer in the documentation?
  12. Bill Evans at Mariposa

    Solved Examine all IPC shared memory segments

    As root, I can examine the characteristics of all IPC shared memory segments. But is there a way to see them all that's more straightforward than throwing a Brazillion segment IDs at the wall to see which ones stick, as below? #include <sys/ipc.h> #include <sys/shm.h> #include <sys/types.h>...
  13. Bill Evans at Mariposa

    accepting the forum terms and rules

    It's been a while since I've visited the FreeBSD forums. I log in, and am prompted to accept the terms and rules. I click on "terms and rules" so I can read them, and am sent to the "Forums Rules and Guidelines" forum. I click on "FreeBSD Forum Rules", just to refresh my memory. In response to...
  14. Bill Evans at Mariposa

    C detecting that I'm compiling for FreeBSD

    One if by land, two if by sea. Port left, starboard right. Stalagmites go up, stalactites g down. __linux__ lower case, __FreeBSD__ mixed case. Got it!
  15. Bill Evans at Mariposa

    C detecting that I'm compiling for FreeBSD

    If, say, I'm compiling with gcc under Linux, a section of code will compile if it looks like this: #if __linux__ /* your ad here */ #endif How do I do such conditional compilation for FreeBSD (other than inverting the __linux__ test)? I'm hoping the answer would apply equally to clang and gcc...
  16. Bill Evans at Mariposa

    gimp postscript level 2

    My current questions are: 1. Is the question following these two questions appropriate for forums.freebsd.org? 2. If so, which forum should contain the main question? And the main question is this: I'm using FreeBSD 11.1-RELEASE, gimp version 2.8.22. I have loaded an image, and "print" it to...
  17. Bill Evans at Mariposa

    man page section titles for ell and en

    The man page for 'man(1)' lists titles for nine man page sections: FreeBSD General Commands Manual FreeBSD System Calls Manual FreeBSD Library Functions Manual FreeBSD Kernel Interfaces Manual FreeBSD File Formats Manual FreeBSD Games Manual FreeBSD Miscellaneous Information Manual FreeBSD...
  18. Bill Evans at Mariposa

    Porting drivers from Linux to FreeBSD

    Oh, I am so going to steal this.
  19. Bill Evans at Mariposa

    Solved sbcl: retrieving the script name

    It turns out that for sbcl, a correct (at least as far as I can tell) lightweight solution would be as in this script:#!/usr/local/bin/sbcl --script (prin1 (apply #'concatenate 'string (remove-if #'null (list (pathname-name *load-truename*) (when...
Back
Top