-- Leo's gemini proxy
-- Connecting to git.thebackupbox.net:1965...
-- Connected
-- Sending request
-- Meta line: 20 text/gemini
repo: rxvt-unicode-sixel action: commit revision: path_from: revision_from: 49ccc964e4c07c33fdb0ef162df1e34f5edf7970: path_to: revision_to:
commit 49ccc964e4c07c33fdb0ef162df1e34f5edf7970 Author: Marc Lehmann <schmorp@schmorp.de> Date: Mon Feb 2 22:38:40 2009 +0000 *** empty log message *** diff --git a/Changes b/Changes
--- a/Changes +++ b/Changes @@ -21,6 +21,8 @@ DUMB: support tex fonts TODO: exg-- patch TODO: selection_beg/end should set screen, or so + - enable --mlock option for urxvt with frills on + systems supporting it (patch by Russell Harmon). - urxvt did not compile without frills enabled (analysed by Matthew Rosewarne). diff --git a/doc/rxvt.7.pod b/doc/rxvt.7.pod
--- a/doc/rxvt.7.pod +++ b/doc/rxvt.7.pod @@ -1210,6 +1210,12 @@ possibly working workaround is to use a wcwidth implementation like http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c +=head3 I want 256 colors + +Are you sure you need 256 colors? 88 colors should be enough for most +purposes. If you really need more, there is an unsupported patch for +it in the doc directory, but please do not ask for it to be applied. + =head1 RXVT-UNICODE TECHNICAL REFERENCE The rest of this document describes various technical aspects of diff --git a/doc/rxvtd.1.pod b/doc/rxvtd.1.pod
--- a/doc/rxvtd.1.pod +++ b/doc/rxvtd.1.pod @@ -4,7 +4,7 @@ =head1 SYNOPSIS -B<@@RXVT_NAME@@d> [-q|--quiet] [-o|--opendisplay] [-f|--fork] +B<@@RXVT_NAME@@d> [-q|--quiet] [-o|--opendisplay] [-f|--fork] [-m|--mlock] B<@@RXVT_NAME@@d> -q -o -f # for .xsession use @@ -54,6 +54,21 @@ B<@@RXVT_NAME@@d> will be killed automatically. This makes B<@@RXVT_NAME@@d> fork after it has bound itself to its control socket. +=item B<-m>, B<--mlock> + +This makes B<@@RXVT_NAME@@d> call mlockall(2) on itself. This locks +B<@@RXVT_NAME@@d> in RAM and prevents it from being swapped out to disk, +at the cost of consuming a lot more memory on most operating systems. + +Note: In order to use this feature, your system administrator must have set +your user's RLIMIT_MEMLOCK to a size greater than or equal to the size of the +B<@@RXVT_NAME@@d> binary (or to unlimited). See F</etc/security/limits.conf>. + +Note 2: There is a known bug in glibc (possibly fixed in 2.8 and later +versions) where calloc returns non-zeroed memory when mlockall is in +effect. If you experience crashes or other odd behaviour while using +--mlock, try it without it. + =back =head1 EXAMPLES diff --git a/src/rxvtd.C b/src/rxvtd.C
--- a/src/rxvtd.C +++ b/src/rxvtd.C @@ -33,6 +33,14 @@ #include <sys/socket.h> #include <sys/un.h> +#if defined(ENABLE_FRILLS) && defined(_POSIX_MEMLOCK) && _POSIX_MEMLOCK > 0 +# define ENABLE_MLOCK 1 +#endif + +#if ENABLE_MLOCK +# include <sys/mman.h> +#endif + #include <cerrno> #include "rxvt.h" @@ -217,6 +225,9 @@ void server::read_cb (ev::io &w, int revents) } int opt_fork, opt_opendisplay, opt_quiet; +#if ENABLE_MLOCK +int opt_lock; +#endif int main (int argc, const char *const *argv) @@ -231,6 +242,10 @@ main (int argc, const char *const *argv) opt_opendisplay = 1; else if (!strcmp (argv [i], "-q") || !strcmp (argv [i], "--quiet")) opt_quiet = 1; +#if ENABLE_MLOCK + else if (!strcmp (argv [i], "-m") || !strcmp (argv [i], "--mlock")) + opt_lock = 1; +#endif else { rxvt_log ("%s: unknown option '%s', aborting.\n", argv [0], argv [i]); @@ -256,10 +271,21 @@ main (int argc, const char *const *argv) free (sockname); + pid_t pid = 0; if (opt_fork) { - pid_t pid = fork (); + pid = fork (); + } +#if ENABLE_MLOCK + // Optionally preform a mlockall so this process does not get swapped out. + if (opt_lock && pid == 0) + if (mlockall(MCL_CURRENT | MCL_FUTURE) == -1) + perror("unable to lock into ram"); +#endif + + if (opt_fork) + { if (pid < 0) { rxvt_log ("unable to fork daemon, aborting.\n");
-----END OF PAGE-----
-- Response ended
-- Page fetched on Sun Jun 2 14:00:24 2024