YoushouldhavereceivedacopyoftheGNUGeneralPublicLicense alongwiththisprogram;ifnot,writetotheFreeSoftware
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
int main(int argc, char *argv[])
{ int pid= 0, t= 0, sig= 0;
MY_INIT(argv[0]);
if (handle_options(&argc, &argv, my_long_options, get_one_option)) exit(-1); if (!argv[0] || !argv[1] || (pid= atoi(argv[0])) <= 0 ||
(t= atoi(argv[1])) <= 0)
{
usage(); exit(-1);
} for (; t > 0; t--)
{ if (kill((pid_t) pid, sig))
{ if (errno == EINVAL)
{ if (verbose)
printf("WARNING: kill couldn't handle signal 0, using signal 1.\n");
sig= 1;
t++; continue;
} return0;
}
sleep(1);
} return1;
}
void usage(void)
{
printf("%s version %s by Jani Tolonen\n\n", my_progname, VER);
printf("usage: %s [options] #pid #time\n\n", my_progname);
printf("Description: Waits for a program, which program id is #pid, to\n");
printf("terminate within #time seconds. If the program terminates within\n");
printf("this time, or if the #pid no longer exists, value 0 is returned.\n");
printf("Otherwise 1 is returned. Both #pid and #time must be positive\n");
printf("integer arguments.\n\n");
printf("Options:\n");
my_print_help(my_long_options);
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.22 Sekunden
(vorverarbeitet am 2026-10-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.