core: add option weechat.startup.sys_rlimit to set system resource limits for WeeChat process
This commit is contained in:
parent
67c78085c9
commit
d685d5fb42
@ -1,12 +1,14 @@
|
||||
WeeChat ChangeLog
|
||||
=================
|
||||
Sébastien Helleu <flashcode@flashtux.org>
|
||||
v0.3.9-dev, 2012-07-30
|
||||
v0.3.9-dev, 2012-08-01
|
||||
|
||||
|
||||
Version 0.3.9 (under dev!)
|
||||
--------------------------
|
||||
|
||||
* core: add option weechat.startup.sys_rlimit to set system resource limits for
|
||||
WeeChat process
|
||||
* core: add option "swap" for command /buffer (task #11373)
|
||||
* core: fix names of cache variables in configure.in (bug #36971)
|
||||
* core: scroll to bottom of window after reaching first or last highlight with
|
||||
|
@ -15,6 +15,7 @@
|
||||
#cmakedefine HAVE_REGEX_H
|
||||
#cmakedefine HAVE_WCHAR_H
|
||||
#cmakedefine HAVE_SYS_FILE_H
|
||||
#cmakedefine HAVE_SYS_RESOURCE_H
|
||||
#cmakedefine HAVE_FLOCK
|
||||
#cmakedefine HAVE_LANGINFO_CODESET
|
||||
#cmakedefine HAVE_STRNDUP
|
||||
|
@ -68,7 +68,7 @@ AC_CHECK_LIB(ncursesw, initscr, LIBNCURSESW_FOUND=1, LIBNCURSESW_FOUND=0)
|
||||
|
||||
# Checks for header files
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS([arpa/inet.h libintl.h limits.h locale.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h sys/types.h unistd.h pwd.h errno.h regex.h wchar.h sys/file.h])
|
||||
AC_CHECK_HEADERS([arpa/inet.h libintl.h limits.h locale.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h sys/types.h unistd.h pwd.h errno.h regex.h wchar.h sys/file.h sys/resource.h])
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics
|
||||
AC_HEADER_TIME
|
||||
|
@ -823,3 +823,8 @@
|
||||
** Typ: boolesch
|
||||
** Werte: on, off (Standardwert: `on`)
|
||||
|
||||
* [[option_weechat.startup.sys_rlimit]] *weechat.startup.sys_rlimit*
|
||||
** Beschreibung: `set resource limits for WeeChat process, format is: "res1:limit1,res2:limit2"; resource name is the end of constant (RLIMIT_XXX) in lower case (see man setrlimit for values); limit -1 means "unlimited"; example: set unlimited size for core file and max 1GB of virtual memory: "core:-1,as:1000000000"`
|
||||
** Typ: Zeichenkette
|
||||
** Werte: beliebige Zeichenkette (Standardwert: `""`)
|
||||
|
||||
|
@ -207,7 +207,17 @@ Wird ein Binärpaket genutzt dann muss zusätzlich das Paket 'weechat-dbg' insta
|
||||
Core Dateien
|
||||
^^^^^^^^^^^^
|
||||
|
||||
Um 'core' Dateien zu aktivieren muss der `ulimit` Befehl genutzt werden.
|
||||
// TRANSLATION MISSING
|
||||
To enable 'core' files, you can use option
|
||||
<<option_weechat.startup.sys_rlimit,weechat.startup.sys_rlimit>>:
|
||||
|
||||
----------------------------------------
|
||||
/set weechat.startup.sys_rlimit "core:-1"
|
||||
----------------------------------------
|
||||
|
||||
// TRANSLATION MISSING
|
||||
For WeeChat ≤ 0.3.8 or if you want to enable core files even before WeeChat
|
||||
starts, you can use `ulimit` command.
|
||||
|
||||
Zum Beispiel muss unter Linux in einer 'bash' Shell folgender Befehl in die `~/.bashrc`
|
||||
Datei eingetragen werden:
|
||||
|
@ -823,3 +823,8 @@
|
||||
** type: boolean
|
||||
** values: on, off (default value: `on`)
|
||||
|
||||
* [[option_weechat.startup.sys_rlimit]] *weechat.startup.sys_rlimit*
|
||||
** description: `set resource limits for WeeChat process, format is: "res1:limit1,res2:limit2"; resource name is the end of constant (RLIMIT_XXX) in lower case (see man setrlimit for values); limit -1 means "unlimited"; example: set unlimited size for core file and max 1GB of virtual memory: "core:-1,as:1000000000"`
|
||||
** type: string
|
||||
** values: any string (default value: `""`)
|
||||
|
||||
|
@ -209,7 +209,15 @@ If you installed a binary package, then install package 'weechat-dbg'.
|
||||
Core files
|
||||
^^^^^^^^^^
|
||||
|
||||
To enable 'core' files, you have to use `ulimit` command.
|
||||
To enable 'core' files, you can use option
|
||||
<<option_weechat.startup.sys_rlimit,weechat.startup.sys_rlimit>>:
|
||||
|
||||
----------------------------------------
|
||||
/set weechat.startup.sys_rlimit "core:-1"
|
||||
----------------------------------------
|
||||
|
||||
For WeeChat ≤ 0.3.8 or if you want to enable core files even before WeeChat
|
||||
starts, you can use `ulimit` command.
|
||||
|
||||
For example under Linux with 'bash' shell, add this line to your `~/.bashrc`:
|
||||
|
||||
|
@ -823,3 +823,8 @@
|
||||
** type: booléen
|
||||
** valeurs: on, off (valeur par défaut: `on`)
|
||||
|
||||
* [[option_weechat.startup.sys_rlimit]] *weechat.startup.sys_rlimit*
|
||||
** description: `définir les limites de ressource pour le processus WeeChat, le format est: "res1:limite1,res2:limite2"; le nom de ressource est la fin de la constante (RLIMIT_XXX) en minuscules (voir man setrlimit pour les valeurs); une limite de -1 siginifie "illimitée"; exemple: définir une taille illimitée pour le fichier core et max 1 Go de mémoire virtuelle: "core:-1,as:1000000000"`
|
||||
** type: chaîne
|
||||
** valeurs: toute chaîne (valeur par défaut: `""`)
|
||||
|
||||
|
@ -213,7 +213,15 @@ Si vous avez installé un paquet binaire, alors installez le paquet
|
||||
Fichiers core
|
||||
^^^^^^^^^^^^^
|
||||
|
||||
Pour activer les fichiers 'core', vous devez utiliser la commande `ulimit`.
|
||||
Pour activer les fichiers 'core', vous pouvez utiliser l'option
|
||||
<<option_weechat.startup.sys_rlimit,weechat.startup.sys_rlimit>>:
|
||||
|
||||
----------------------------------------
|
||||
/set weechat.startup.sys_rlimit "core:-1"
|
||||
----------------------------------------
|
||||
|
||||
Pour WeeChat ≤ 0.3.8 ou si vous voulez activer les fichiers core avant que
|
||||
WeeChat ne démarre, vous pouvez utiliser la commande `ulimit`.
|
||||
|
||||
Par exemple sous Linux avec le shell 'bash', ajoutez cette ligne dans votre
|
||||
`~/.bashrc`:
|
||||
|
@ -823,3 +823,8 @@
|
||||
** tipo: bool
|
||||
** valori: on, off (valore predefinito: `on`)
|
||||
|
||||
* [[option_weechat.startup.sys_rlimit]] *weechat.startup.sys_rlimit*
|
||||
** descrizione: `set resource limits for WeeChat process, format is: "res1:limit1,res2:limit2"; resource name is the end of constant (RLIMIT_XXX) in lower case (see man setrlimit for values); limit -1 means "unlimited"; example: set unlimited size for core file and max 1GB of virtual memory: "core:-1,as:1000000000"`
|
||||
** tipo: stringa
|
||||
** valori: qualsiasi stringa (valore predefinito: `""`)
|
||||
|
||||
|
@ -214,7 +214,17 @@ Se è stato installato il pacchetto binario, installare il pacchetto 'weechat-gd
|
||||
File core
|
||||
^^^^^^^^^
|
||||
|
||||
Per abilitare i file 'core', è necessario usare il comando `ulimit`.
|
||||
// TRANSLATION MISSING
|
||||
To enable 'core' files, you can use option
|
||||
<<option_weechat.startup.sys_rlimit,weechat.startup.sys_rlimit>>:
|
||||
|
||||
----------------------------------------
|
||||
/set weechat.startup.sys_rlimit "core:-1"
|
||||
----------------------------------------
|
||||
|
||||
// TRANSLATION MISSING
|
||||
For WeeChat ≤ 0.3.8 or if you want to enable core files even before WeeChat
|
||||
starts, you can use `ulimit` command.
|
||||
|
||||
Ad esempio su Linux con la shell 'bash', aggiungere questa riga al proprio
|
||||
`~/.bashrc`:
|
||||
|
27
po/cs.po
27
po/cs.po
@ -20,7 +20,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WeeChat 0.3.9-dev\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2012-07-29 20:00+0200\n"
|
||||
"POT-Creation-Date: 2012-08-01 08:57+0200\n"
|
||||
"PO-Revision-Date: 2012-06-03 09:49+0200\n"
|
||||
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
@ -2223,6 +2223,14 @@ msgstr "zobrazí WeeChat logo při spuštění"
|
||||
msgid "display WeeChat version at startup"
|
||||
msgstr "zobrazí verzi WeeChat při spuštění"
|
||||
|
||||
msgid ""
|
||||
"set resource limits for WeeChat process, format is: \"res1:limit1,res2:"
|
||||
"limit2\"; resource name is the end of constant (RLIMIT_XXX) in lower case "
|
||||
"(see man setrlimit for values); limit -1 means \"unlimited\"; example: set "
|
||||
"unlimited size for core file and max 1GB of virtual memory: \"core:-1,"
|
||||
"as:1000000000\""
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"alignment for end of lines (all lines after the first): they are starting "
|
||||
"under this data (time, buffer, prefix, suffix, message (default))"
|
||||
@ -3236,6 +3244,23 @@ msgstr ""
|
||||
"čtení - špatný podpis (formát aktualizačního souboru se mohl změnit od "
|
||||
"poslední verze)"
|
||||
|
||||
#, c-format
|
||||
msgid "%sError: invalid limit for resource \"%s\": %s (must be >= -1)"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "Limit for resource \"%s\" has been set to %s"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy, c-format
|
||||
msgid "%sError: unable to set resource limit \"%s\" to %s: error %d %s"
|
||||
msgstr "%sChyba: nemohu nastavit volbu \"%s\" pro proxy \"%s\""
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"%sError: unknown resource limit \"%s\" (see /help weechat.startup.sys_rlimit)"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Warning: the %d color pairs are used, do \"/color reset\" to remove unused "
|
||||
|
27
po/de.po
27
po/de.po
@ -23,7 +23,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WeeChat 0.3.7-dev\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2012-07-29 20:00+0200\n"
|
||||
"POT-Creation-Date: 2012-08-01 08:57+0200\n"
|
||||
"PO-Revision-Date: 2012-07-22 23:37+0100\n"
|
||||
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
|
||||
"Language-Team: German <weechatter@arcor.de>\n"
|
||||
@ -2419,6 +2419,14 @@ msgstr "WeeChat-Logo beim Start anzeigen"
|
||||
msgid "display WeeChat version at startup"
|
||||
msgstr "WeeChat-Version beim Start anzeigen"
|
||||
|
||||
msgid ""
|
||||
"set resource limits for WeeChat process, format is: \"res1:limit1,res2:"
|
||||
"limit2\"; resource name is the end of constant (RLIMIT_XXX) in lower case "
|
||||
"(see man setrlimit for values); limit -1 means \"unlimited\"; example: set "
|
||||
"unlimited size for core file and max 1GB of virtual memory: \"core:-1,"
|
||||
"as:1000000000\""
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"alignment for end of lines (all lines after the first): they are starting "
|
||||
"under this data (time, buffer, prefix, suffix, message (default))"
|
||||
@ -3571,6 +3579,23 @@ msgstr ""
|
||||
"lese - falsche Signatur (das Dateiformat wurde vermutlich seit der letzten "
|
||||
"Version verändern)"
|
||||
|
||||
#, c-format
|
||||
msgid "%sError: invalid limit for resource \"%s\": %s (must be >= -1)"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "Limit for resource \"%s\" has been set to %s"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy, c-format
|
||||
msgid "%sError: unable to set resource limit \"%s\" to %s: error %d %s"
|
||||
msgstr "%sFehler: Option \"%s\" kann für den Proxy \"%s\" nicht setzt werden"
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"%sError: unknown resource limit \"%s\" (see /help weechat.startup.sys_rlimit)"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Warning: the %d color pairs are used, do \"/color reset\" to remove unused "
|
||||
|
27
po/es.po
27
po/es.po
@ -22,7 +22,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WeeChat 0.3.9-dev\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2012-07-29 20:00+0200\n"
|
||||
"POT-Creation-Date: 2012-08-01 08:57+0200\n"
|
||||
"PO-Revision-Date: 2012-07-27 12:16+0200\n"
|
||||
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
@ -2336,6 +2336,14 @@ msgstr "mostrar el logotipo de WeeChat en el arranque"
|
||||
msgid "display WeeChat version at startup"
|
||||
msgstr "mostrar la versión de WeeChat en el arranque"
|
||||
|
||||
msgid ""
|
||||
"set resource limits for WeeChat process, format is: \"res1:limit1,res2:"
|
||||
"limit2\"; resource name is the end of constant (RLIMIT_XXX) in lower case "
|
||||
"(see man setrlimit for values); limit -1 means \"unlimited\"; example: set "
|
||||
"unlimited size for core file and max 1GB of virtual memory: \"core:-1,"
|
||||
"as:1000000000\""
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"alignment for end of lines (all lines after the first): they are starting "
|
||||
"under this data (time, buffer, prefix, suffix, message (default))"
|
||||
@ -3423,6 +3431,23 @@ msgstr ""
|
||||
"lectura - firma incorrecta (el formato del archivo de actualización puede "
|
||||
"haber cambiado desde la última versión)"
|
||||
|
||||
#, c-format
|
||||
msgid "%sError: invalid limit for resource \"%s\": %s (must be >= -1)"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "Limit for resource \"%s\" has been set to %s"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy, c-format
|
||||
msgid "%sError: unable to set resource limit \"%s\" to %s: error %d %s"
|
||||
msgstr "%sError: no se pudo configurar la opción \"%s\" para el proxy \"%s\""
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"%sError: unknown resource limit \"%s\" (see /help weechat.startup.sys_rlimit)"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Warning: the %d color pairs are used, do \"/color reset\" to remove unused "
|
||||
|
63
po/fr.po
63
po/fr.po
@ -21,8 +21,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WeeChat 0.3.9-dev\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2012-07-29 20:00+0200\n"
|
||||
"PO-Revision-Date: 2012-07-29 20:00+0200\n"
|
||||
"POT-Creation-Date: 2012-08-01 08:57+0200\n"
|
||||
"PO-Revision-Date: 2012-08-01 09:02+0200\n"
|
||||
"Last-Translator: Sebastien Helleu <flashcode@flashtux.org>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
"Language: French\n"
|
||||
@ -2351,6 +2351,20 @@ msgstr "afficher le logo WeeChat au démarrage"
|
||||
msgid "display WeeChat version at startup"
|
||||
msgstr "afficher la version de WeeChat au démarrage"
|
||||
|
||||
msgid ""
|
||||
"set resource limits for WeeChat process, format is: \"res1:limit1,res2:"
|
||||
"limit2\"; resource name is the end of constant (RLIMIT_XXX) in lower case "
|
||||
"(see man setrlimit for values); limit -1 means \"unlimited\"; example: set "
|
||||
"unlimited size for core file and max 1GB of virtual memory: \"core:-1,"
|
||||
"as:1000000000\""
|
||||
msgstr ""
|
||||
"définir les limites de ressource pour le processus WeeChat, le format est: "
|
||||
"\"res1:limite1,res2:limite2\"; le nom de ressource est la fin de la "
|
||||
"constante (RLIMIT_XXX) en minuscules (voir man setrlimit pour les valeurs); "
|
||||
"une limite de -1 siginifie \"illimitée\"; exemple: définir une taille "
|
||||
"illimitée pour le fichier core et max 1 Go de mémoire virtuelle: \"core:-1,"
|
||||
"as:1000000000\""
|
||||
|
||||
msgid ""
|
||||
"alignment for end of lines (all lines after the first): they are starting "
|
||||
"under this data (time, buffer, prefix, suffix, message (default))"
|
||||
@ -3460,6 +3474,27 @@ msgstr ""
|
||||
"lecture - mauvaise signature (le format de fichier upgrade a peut-être "
|
||||
"changé depuis la dernière version)"
|
||||
|
||||
#, c-format
|
||||
msgid "%sError: invalid limit for resource \"%s\": %s (must be >= -1)"
|
||||
msgstr "%sErreur: limite de ressource \"%s\" invalide: %s (doit être >= 1)"
|
||||
|
||||
#, c-format
|
||||
msgid "Limit for resource \"%s\" has been set to %s"
|
||||
msgstr "La limite de ressource \"%s\" a été modifiée en %s"
|
||||
|
||||
#, c-format
|
||||
msgid "%sError: unable to set resource limit \"%s\" to %s: error %d %s"
|
||||
msgstr ""
|
||||
"%sErreur: impossible de définir la limite de ressource \"%s\" à %s: erreur "
|
||||
"%d %s"
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"%sError: unknown resource limit \"%s\" (see /help weechat.startup.sys_rlimit)"
|
||||
msgstr ""
|
||||
"%sErreur: limite de ressource \"%s\" inconnue (voir /help weechat.startup."
|
||||
"sys_rlimit)"
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Warning: the %d color pairs are used, do \"/color reset\" to remove unused "
|
||||
@ -8884,27 +8919,3 @@ msgstr "Type"
|
||||
|
||||
msgid "Constants"
|
||||
msgstr "Constantes"
|
||||
|
||||
#~ msgid "smart completion for nicks (completes first with last speakers)"
|
||||
#~ msgstr ""
|
||||
#~ "complétion intelligente pour les pseudos (complète d'abord avec les "
|
||||
#~ "personnes qui ont parlé récemment)"
|
||||
|
||||
#~ msgid "ended on: "
|
||||
#~ msgstr "terminé le: "
|
||||
|
||||
#~ msgid "%s%-26s id: %d, protocol: %s, received: %s, sent: %s"
|
||||
#~ msgstr "%s%-26s id: %d, protocole: %s, reçu: %s, envoyé: %s"
|
||||
|
||||
#~ msgid "%s: new client from %s%s%s on port %d (id: %d, relaying: %s%s%s%s)"
|
||||
#~ msgstr ""
|
||||
#~ "%s: nouveau client de %s%s%s sur le port %d (id: %d, relai: %s%s%s%s)"
|
||||
|
||||
#~ msgid "text color"
|
||||
#~ msgstr "couleur du texte"
|
||||
|
||||
#~ msgid "background color"
|
||||
#~ msgstr "couleur du fond"
|
||||
|
||||
#~ msgid "text color of selected xfer line"
|
||||
#~ msgstr "couleur du texte pour la ligne xfer sélectionnée"
|
||||
|
27
po/hu.po
27
po/hu.po
@ -20,7 +20,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WeeChat 0.3.9-dev\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2012-07-29 20:00+0200\n"
|
||||
"POT-Creation-Date: 2012-08-01 08:57+0200\n"
|
||||
"PO-Revision-Date: 2012-06-03 09:49+0200\n"
|
||||
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
@ -1920,6 +1920,14 @@ msgstr "WeeChat logo mutatása induláskor"
|
||||
msgid "display WeeChat version at startup"
|
||||
msgstr "WeeChat verziójának mutatása induláskor"
|
||||
|
||||
msgid ""
|
||||
"set resource limits for WeeChat process, format is: \"res1:limit1,res2:"
|
||||
"limit2\"; resource name is the end of constant (RLIMIT_XXX) in lower case "
|
||||
"(see man setrlimit for values); limit -1 means \"unlimited\"; example: set "
|
||||
"unlimited size for core file and max 1GB of virtual memory: \"core:-1,"
|
||||
"as:1000000000\""
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"alignment for end of lines (all lines after the first): they are starting "
|
||||
"under this data (time, buffer, prefix, suffix, message (default))"
|
||||
@ -2898,6 +2906,23 @@ msgid ""
|
||||
"version)"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "%sError: invalid limit for resource \"%s\": %s (must be >= -1)"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "Limit for resource \"%s\" has been set to %s"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy, c-format
|
||||
msgid "%sError: unable to set resource limit \"%s\" to %s: error %d %s"
|
||||
msgstr "%s ismeretlen opció a \"%s\" parancsnak\n"
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"%sError: unknown resource limit \"%s\" (see /help weechat.startup.sys_rlimit)"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Warning: the %d color pairs are used, do \"/color reset\" to remove unused "
|
||||
|
27
po/it.po
27
po/it.po
@ -20,7 +20,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WeeChat 0.3.9-dev\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2012-07-30 16:49+0200\n"
|
||||
"POT-Creation-Date: 2012-08-01 08:57+0200\n"
|
||||
"PO-Revision-Date: 2012-07-30 15:38+0200\n"
|
||||
"Last-Translator: Marco Paolone <marcopaolone@gmail.com>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
@ -2332,6 +2332,14 @@ msgstr "mostra il logo di WeeChat all'avvio"
|
||||
msgid "display WeeChat version at startup"
|
||||
msgstr "mostra la versione di WeeChat all'avvio"
|
||||
|
||||
msgid ""
|
||||
"set resource limits for WeeChat process, format is: \"res1:limit1,res2:"
|
||||
"limit2\"; resource name is the end of constant (RLIMIT_XXX) in lower case "
|
||||
"(see man setrlimit for values); limit -1 means \"unlimited\"; example: set "
|
||||
"unlimited size for core file and max 1GB of virtual memory: \"core:-1,"
|
||||
"as:1000000000\""
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"alignment for end of lines (all lines after the first): they are starting "
|
||||
"under this data (time, buffer, prefix, suffix, message (default))"
|
||||
@ -3411,6 +3419,23 @@ msgstr ""
|
||||
"lettura - firma errata (l'aggiornamento del formato del file potrebbe essere "
|
||||
"cambiato dall'ultima versione)"
|
||||
|
||||
#, c-format
|
||||
msgid "%sError: invalid limit for resource \"%s\": %s (must be >= -1)"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "Limit for resource \"%s\" has been set to %s"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy, c-format
|
||||
msgid "%sError: unable to set resource limit \"%s\" to %s: error %d %s"
|
||||
msgstr "%sErrore: impossibile impostare l'opzione \"%s\" per il proxy \"%s\""
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"%sError: unknown resource limit \"%s\" (see /help weechat.startup.sys_rlimit)"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Warning: the %d color pairs are used, do \"/color reset\" to remove unused "
|
||||
|
28
po/ja.po
28
po/ja.po
@ -20,7 +20,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WeeChat 0.3.9-dev\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2012-07-29 20:00+0200\n"
|
||||
"POT-Creation-Date: 2012-08-01 08:57+0200\n"
|
||||
"PO-Revision-Date: 2012-07-27 12:16+0200\n"
|
||||
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
|
||||
"Language-Team: Japanese <https://github.com/l/WeeChat>\n"
|
||||
@ -2294,6 +2294,14 @@ msgstr "WeeChat ロゴを開始時に表示"
|
||||
msgid "display WeeChat version at startup"
|
||||
msgstr "WeeChat バージョンを開始時に表示"
|
||||
|
||||
msgid ""
|
||||
"set resource limits for WeeChat process, format is: \"res1:limit1,res2:"
|
||||
"limit2\"; resource name is the end of constant (RLIMIT_XXX) in lower case "
|
||||
"(see man setrlimit for values); limit -1 means \"unlimited\"; example: set "
|
||||
"unlimited size for core file and max 1GB of virtual memory: \"core:-1,"
|
||||
"as:1000000000\""
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"alignment for end of lines (all lines after the first): they are starting "
|
||||
"under this data (time, buffer, prefix, suffix, message (default))"
|
||||
@ -3329,6 +3337,24 @@ msgstr ""
|
||||
"読み込み - 不正な署名 (ファイルフォーマットのアップグレードが最新バージョンか"
|
||||
"ら変更された可能性があります)"
|
||||
|
||||
#, c-format
|
||||
msgid "%sError: invalid limit for resource \"%s\": %s (must be >= -1)"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "Limit for resource \"%s\" has been set to %s"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy, c-format
|
||||
msgid "%sError: unable to set resource limit \"%s\" to %s: error %d %s"
|
||||
msgstr ""
|
||||
"%1$sエラー: プロキシ \"%3$s\" に対するオプション \"%2$s\" を設定できません"
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"%sError: unknown resource limit \"%s\" (see /help weechat.startup.sys_rlimit)"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Warning: the %d color pairs are used, do \"/color reset\" to remove unused "
|
||||
|
27
po/pl.po
27
po/pl.po
@ -21,7 +21,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WeeChat 0.3.9-dev\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2012-07-29 20:00+0200\n"
|
||||
"POT-Creation-Date: 2012-08-01 08:57+0200\n"
|
||||
"PO-Revision-Date: 2012-07-27 12:16+0200\n"
|
||||
"Last-Translator: Krzysztof Korościk <soltys@szluug.org>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
@ -2340,6 +2340,14 @@ msgstr "wyświetl logo WeeChat podczas uruchamiania"
|
||||
msgid "display WeeChat version at startup"
|
||||
msgstr "wyświetl wersję WeeChat podczas uruchamiania"
|
||||
|
||||
msgid ""
|
||||
"set resource limits for WeeChat process, format is: \"res1:limit1,res2:"
|
||||
"limit2\"; resource name is the end of constant (RLIMIT_XXX) in lower case "
|
||||
"(see man setrlimit for values); limit -1 means \"unlimited\"; example: set "
|
||||
"unlimited size for core file and max 1GB of virtual memory: \"core:-1,"
|
||||
"as:1000000000\""
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"alignment for end of lines (all lines after the first): they are starting "
|
||||
"under this data (time, buffer, prefix, suffix, message (default))"
|
||||
@ -3405,6 +3413,23 @@ msgid ""
|
||||
msgstr ""
|
||||
"odczyt - zła sygnatura (format pliku mógł ulec zmianie od poprzedniej wersji)"
|
||||
|
||||
#, c-format
|
||||
msgid "%sError: invalid limit for resource \"%s\": %s (must be >= -1)"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "Limit for resource \"%s\" has been set to %s"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy, c-format
|
||||
msgid "%sError: unable to set resource limit \"%s\" to %s: error %d %s"
|
||||
msgstr "%sBłąd: nie można ustawić opcji \"%s\" dla proxy \"%s\""
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"%sError: unknown resource limit \"%s\" (see /help weechat.startup.sys_rlimit)"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Warning: the %d color pairs are used, do \"/color reset\" to remove unused "
|
||||
|
27
po/pt_BR.po
27
po/pt_BR.po
@ -21,7 +21,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WeeChat 0.3.9-dev\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2012-07-29 20:00+0200\n"
|
||||
"POT-Creation-Date: 2012-08-01 08:57+0200\n"
|
||||
"PO-Revision-Date: 2012-06-03 09:49+0200\n"
|
||||
"Last-Translator: Sergio Durigan Junior <sergiosdj@gmail.com>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
@ -2299,6 +2299,14 @@ msgstr "mosta o logo do WeeChat na inicialização"
|
||||
msgid "display WeeChat version at startup"
|
||||
msgstr "mosta a versão do WeeChat na inicialização"
|
||||
|
||||
msgid ""
|
||||
"set resource limits for WeeChat process, format is: \"res1:limit1,res2:"
|
||||
"limit2\"; resource name is the end of constant (RLIMIT_XXX) in lower case "
|
||||
"(see man setrlimit for values); limit -1 means \"unlimited\"; example: set "
|
||||
"unlimited size for core file and max 1GB of virtual memory: \"core:-1,"
|
||||
"as:1000000000\""
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"alignment for end of lines (all lines after the first): they are starting "
|
||||
"under this data (time, buffer, prefix, suffix, message (default))"
|
||||
@ -3324,6 +3332,23 @@ msgid ""
|
||||
"version)"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "%sError: invalid limit for resource \"%s\": %s (must be >= -1)"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "Limit for resource \"%s\" has been set to %s"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy, c-format
|
||||
msgid "%sError: unable to set resource limit \"%s\" to %s: error %d %s"
|
||||
msgstr "%sErro : incapaz de configurar a opção \"%s\" para o proxy \"%s\""
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"%sError: unknown resource limit \"%s\" (see /help weechat.startup.sys_rlimit)"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Warning: the %d color pairs are used, do \"/color reset\" to remove unused "
|
||||
|
27
po/ru.po
27
po/ru.po
@ -21,7 +21,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WeeChat 0.3.9-dev\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2012-07-29 20:00+0200\n"
|
||||
"POT-Creation-Date: 2012-08-01 08:57+0200\n"
|
||||
"PO-Revision-Date: 2012-06-03 09:49+0200\n"
|
||||
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
@ -1939,6 +1939,14 @@ msgstr "отображать логотип WeeChat при запуске"
|
||||
msgid "display WeeChat version at startup"
|
||||
msgstr "отображать версию WeeChat при запуске"
|
||||
|
||||
msgid ""
|
||||
"set resource limits for WeeChat process, format is: \"res1:limit1,res2:"
|
||||
"limit2\"; resource name is the end of constant (RLIMIT_XXX) in lower case "
|
||||
"(see man setrlimit for values); limit -1 means \"unlimited\"; example: set "
|
||||
"unlimited size for core file and max 1GB of virtual memory: \"core:-1,"
|
||||
"as:1000000000\""
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"alignment for end of lines (all lines after the first): they are starting "
|
||||
"under this data (time, buffer, prefix, suffix, message (default))"
|
||||
@ -2923,6 +2931,23 @@ msgid ""
|
||||
"version)"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "%sError: invalid limit for resource \"%s\": %s (must be >= -1)"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "Limit for resource \"%s\" has been set to %s"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy, c-format
|
||||
msgid "%sError: unable to set resource limit \"%s\" to %s: error %d %s"
|
||||
msgstr "%s неизвестный параметр для команды \"%s\"\n"
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"%sError: unknown resource limit \"%s\" (see /help weechat.startup.sys_rlimit)"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Warning: the %d color pairs are used, do \"/color reset\" to remove unused "
|
||||
|
@ -7,7 +7,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2012-07-29 20:00+0200\n"
|
||||
"POT-Creation-Date: 2012-08-01 08:57+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@ -1683,6 +1683,14 @@ msgstr ""
|
||||
msgid "display WeeChat version at startup"
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"set resource limits for WeeChat process, format is: \"res1:limit1,res2:"
|
||||
"limit2\"; resource name is the end of constant (RLIMIT_XXX) in lower case "
|
||||
"(see man setrlimit for values); limit -1 means \"unlimited\"; example: set "
|
||||
"unlimited size for core file and max 1GB of virtual memory: \"core:-1,"
|
||||
"as:1000000000\""
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"alignment for end of lines (all lines after the first): they are starting "
|
||||
"under this data (time, buffer, prefix, suffix, message (default))"
|
||||
@ -2542,6 +2550,23 @@ msgid ""
|
||||
"version)"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "%sError: invalid limit for resource \"%s\": %s (must be >= -1)"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "Limit for resource \"%s\" has been set to %s"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "%sError: unable to set resource limit \"%s\" to %s: error %d %s"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"%sError: unknown resource limit \"%s\" (see /help weechat.startup.sys_rlimit)"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Warning: the %d color pairs are used, do \"/color reset\" to remove unused "
|
||||
|
@ -46,6 +46,7 @@ CHECK_INCLUDE_FILES("pwd.h" HAVE_PWD_H)
|
||||
CHECK_INCLUDE_FILES("errno.h" HAVE_ERRNO_H)
|
||||
CHECK_INCLUDE_FILES("wchar.h" HAVE_WCHAR_H)
|
||||
CHECK_INCLUDE_FILES("langinfo.h" HAVE_LANGINFO_CODESET)
|
||||
CHECK_INCLUDE_FILES("sys/resource.h" HAVE_SYS_RESOURCE_H)
|
||||
|
||||
CHECK_FUNCTION_EXISTS(gethostbyname HAVE_GETHOSTBYNAME)
|
||||
CHECK_FUNCTION_EXISTS(gethostname HAVE_GETHOSTNAME)
|
||||
|
@ -76,6 +76,7 @@ struct t_config_option *config_startup_command_after_plugins;
|
||||
struct t_config_option *config_startup_command_before_plugins;
|
||||
struct t_config_option *config_startup_display_logo;
|
||||
struct t_config_option *config_startup_display_version;
|
||||
struct t_config_option *config_startup_sys_rlimit;
|
||||
|
||||
/* config, look & feel section */
|
||||
|
||||
@ -260,6 +261,21 @@ char **config_plugin_extensions = NULL;
|
||||
int config_num_plugin_extensions = 0;
|
||||
|
||||
|
||||
/*
|
||||
* config_change_sys_rlimit: called when the system resource limits is changed
|
||||
*/
|
||||
|
||||
void
|
||||
config_change_sys_rlimit (void *data, struct t_config_option *option)
|
||||
{
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) option;
|
||||
|
||||
if (gui_init_ok)
|
||||
util_setrlimit ();
|
||||
}
|
||||
|
||||
/*
|
||||
* config_change_save_config_on_exit: called when "save_config_on_exit" flag is changed
|
||||
*/
|
||||
@ -747,6 +763,8 @@ config_weechat_init_after_read ()
|
||||
{
|
||||
int i;
|
||||
|
||||
util_setrlimit ();
|
||||
|
||||
gui_buffer_notify_set_all ();
|
||||
|
||||
proxy_use_temp_proxies ();
|
||||
@ -1729,6 +1747,16 @@ config_weechat_init_options ()
|
||||
"display_version", "boolean",
|
||||
N_("display WeeChat version at startup"),
|
||||
NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
config_startup_sys_rlimit = config_file_new_option (
|
||||
weechat_config_file, ptr_section,
|
||||
"sys_rlimit", "string",
|
||||
N_("set resource limits for WeeChat process, format is: "
|
||||
"\"res1:limit1,res2:limit2\"; resource name is the end of constant "
|
||||
"(RLIMIT_XXX) in lower case (see man setrlimit for values); limit "
|
||||
"-1 means \"unlimited\"; example: set unlimited size for core file "
|
||||
"and max 1GB of virtual memory: \"core:-1,as:1000000000\""),
|
||||
NULL, 0, 0, "", NULL, 0, NULL, NULL,
|
||||
&config_change_sys_rlimit, NULL, NULL, NULL);
|
||||
|
||||
/* look */
|
||||
ptr_section = config_file_new_section (weechat_config_file, "look",
|
||||
|
@ -102,6 +102,7 @@ extern struct t_config_option *config_startup_command_after_plugins;
|
||||
extern struct t_config_option *config_startup_command_before_plugins;
|
||||
extern struct t_config_option *config_startup_display_logo;
|
||||
extern struct t_config_option *config_startup_display_version;
|
||||
extern struct t_config_option *config_startup_sys_rlimit;
|
||||
|
||||
extern struct t_config_option *config_look_align_end_of_lines;
|
||||
extern struct t_config_option *config_look_bar_more_left;
|
||||
|
@ -30,6 +30,10 @@
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
#ifdef HAVE_SYS_RESOURCE_H
|
||||
#include <sys/resource.h>
|
||||
#endif
|
||||
#include <unistd.h>
|
||||
#include <dirent.h>
|
||||
#include <signal.h>
|
||||
@ -39,10 +43,181 @@
|
||||
#include "weechat.h"
|
||||
#include "wee-util.h"
|
||||
#include "wee-config.h"
|
||||
#include "wee-log.h"
|
||||
#include "wee-string.h"
|
||||
#include "wee-utf8.h"
|
||||
#include "../gui/gui-chat.h"
|
||||
#include "../gui/gui-window.h"
|
||||
|
||||
|
||||
#ifdef HAVE_SYS_RESOURCE_H
|
||||
struct t_rlimit_resource rlimit_resource[] =
|
||||
{
|
||||
#ifdef RLIMIT_AS
|
||||
{ "as", RLIMIT_AS },
|
||||
#endif
|
||||
#ifdef RLIMIT_CORE
|
||||
{ "core", RLIMIT_CORE },
|
||||
#endif
|
||||
#ifdef RLIMIT_CPU
|
||||
{ "cpu", RLIMIT_CPU },
|
||||
#endif
|
||||
#ifdef RLIMIT_DATA
|
||||
{ "data", RLIMIT_DATA },
|
||||
#endif
|
||||
#ifdef RLIMIT_FSIZE
|
||||
{ "fsize", RLIMIT_FSIZE },
|
||||
#endif
|
||||
#ifdef RLIMIT_LOCKS
|
||||
{ "locks", RLIMIT_LOCKS },
|
||||
#endif
|
||||
#ifdef RLIMIT_MEMLOCK
|
||||
{ "memlock", RLIMIT_MEMLOCK },
|
||||
#endif
|
||||
#ifdef RLIMIT_MSGQUEUE
|
||||
{ "msgqueue", RLIMIT_MSGQUEUE },
|
||||
#endif
|
||||
#ifdef RLIMIT_NICE
|
||||
{ "nice", RLIMIT_NICE },
|
||||
#endif
|
||||
#ifdef RLIMIT_NOFILE
|
||||
{ "nofile", RLIMIT_NOFILE },
|
||||
#endif
|
||||
#ifdef RLIMIT_NPROC
|
||||
{ "nproc", RLIMIT_NPROC },
|
||||
#endif
|
||||
#ifdef RLIMIT_RSS
|
||||
{ "rss", RLIMIT_RSS },
|
||||
#endif
|
||||
#ifdef RLIMIT_RTPRIO
|
||||
{ "rtprio", RLIMIT_RTPRIO },
|
||||
#endif
|
||||
#ifdef RLIMIT_RTTIME
|
||||
{ "rttime", RLIMIT_RTTIME },
|
||||
#endif
|
||||
#ifdef RLIMIT_SIGPENDING
|
||||
{ "sigpending", RLIMIT_SIGPENDING },
|
||||
#endif
|
||||
#ifdef RLIMIT_STACK
|
||||
{ "stack", RLIMIT_STACK },
|
||||
#endif
|
||||
{ NULL, 0 },
|
||||
};
|
||||
#endif /* HAVE_SYS_RESOURCE_H */
|
||||
|
||||
|
||||
/*
|
||||
* util_setrlimit_resource: set resource limit
|
||||
*/
|
||||
|
||||
#ifdef HAVE_SYS_RESOURCE_H
|
||||
void
|
||||
util_setrlimit_resource (const char *resource_name, long limit)
|
||||
{
|
||||
int i;
|
||||
struct rlimit rlim;
|
||||
char str_limit[64];
|
||||
|
||||
if (!resource_name)
|
||||
return;
|
||||
|
||||
if (limit == -1)
|
||||
snprintf (str_limit, sizeof (str_limit), "unlimited");
|
||||
else
|
||||
snprintf (str_limit, sizeof (str_limit), "%ld", limit);
|
||||
|
||||
for (i = 0; rlimit_resource[i].name; i++)
|
||||
{
|
||||
if (strcmp (rlimit_resource[i].name, resource_name) == 0)
|
||||
{
|
||||
if (limit < -1)
|
||||
{
|
||||
gui_chat_printf (NULL,
|
||||
_("%sError: invalid limit for resource \"%s\": "
|
||||
"%s (must be >= -1)"),
|
||||
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
|
||||
resource_name, str_limit);
|
||||
return;
|
||||
}
|
||||
rlim.rlim_cur = (limit >= 0) ? (rlim_t)limit : RLIM_INFINITY;
|
||||
rlim.rlim_max = rlim.rlim_cur;
|
||||
if (setrlimit (rlimit_resource[i].resource, &rlim) == 0)
|
||||
{
|
||||
log_printf (_("Limit for resource \"%s\" has been set to %s"),
|
||||
resource_name, str_limit);
|
||||
if (gui_init_ok)
|
||||
{
|
||||
gui_chat_printf (NULL,
|
||||
_("Limit for resource \"%s\" has been set "
|
||||
"to %s"),
|
||||
resource_name, str_limit);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gui_chat_printf (NULL,
|
||||
_("%sError: unable to set resource limit "
|
||||
"\"%s\" to %s: error %d %s"),
|
||||
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
|
||||
resource_name, str_limit,
|
||||
errno, strerror (errno));
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
gui_chat_printf (NULL,
|
||||
_("%sError: unknown resource limit \"%s\" (see /help "
|
||||
"weechat.startup.sys_rlimit)"),
|
||||
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
|
||||
resource_name);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* util_setrlimit: set resource limits using value of option
|
||||
* "weechat.startup.sys_rlimit"
|
||||
*/
|
||||
|
||||
void
|
||||
util_setrlimit ()
|
||||
{
|
||||
#ifdef HAVE_SYS_RESOURCE_H
|
||||
char **items, *pos, *error;
|
||||
int num_items, i;
|
||||
long number;
|
||||
|
||||
items = string_split (CONFIG_STRING(config_startup_sys_rlimit), ",", 0, 0,
|
||||
&num_items);
|
||||
if (items)
|
||||
{
|
||||
for (i = 0; i < num_items; i++)
|
||||
{
|
||||
pos = strchr (items[i], ':');
|
||||
if (pos)
|
||||
{
|
||||
pos[0] = '\0';
|
||||
error = NULL;
|
||||
number = strtol (pos + 1, &error, 10);
|
||||
if (error && !error[0])
|
||||
{
|
||||
util_setrlimit_resource (items[i], number);
|
||||
}
|
||||
else
|
||||
{
|
||||
gui_chat_printf (NULL,
|
||||
_("%sError: invalid limit for resource "
|
||||
"\"%s\": %s (must be >= -1)"),
|
||||
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
|
||||
items[i], pos + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
string_free_split (items);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* util_timeval_cmp: compare two timeval structures
|
||||
* return: -1 if tv1 < tv2
|
||||
|
@ -20,6 +20,15 @@
|
||||
#ifndef __WEECHAT_UTIL_H
|
||||
#define __WEECHAT_UTIL_H 1
|
||||
|
||||
#ifdef HAVE_SYS_RESOURCE_H
|
||||
struct t_rlimit_resource
|
||||
{
|
||||
char *name; /* name of resource */
|
||||
int resource; /* value of resource */
|
||||
};
|
||||
#endif /* HAVE_SYS_RESOURCE_H */
|
||||
|
||||
extern void util_setrlimit ();
|
||||
extern int util_timeval_cmp (struct timeval *tv1, struct timeval *tv2);
|
||||
extern long util_timeval_diff (struct timeval *tv1, struct timeval *tv2);
|
||||
extern void util_timeval_add (struct timeval *tv, long interval);
|
||||
|
Loading…
x
Reference in New Issue
Block a user