From: Michael Pozhidaev <msp@altlinux.ru>
To: ALT Devel discussion list <devel@altlinux.ru>
Subject: Re: [devel] Просьба потестировать
Date: Sun, 21 Mar 2004 15:03:10 +0600
Message-ID: <405D5A4E.6090906@altlinux.ru> (raw)
In-Reply-To: <20040321082426.GA2031@wrars-comp.wrarsdomain>
Andrey Rahmatullin пишет:
> On Sun, Mar 21, 2004 at 01:20:26PM +0600, Michael Pozhidaev wrote:
>> количество раз. Если у кого-нибудь есть время и возможность, помогите
>> - запустите небольшой экспериментальный файл в своей среде.
> Где файл? ;)
Предыдущее письмо с файлом в рассылку не прошло. Посылаю просто так.
Программа ждёт в качестве первого параметра запуска какой-нибудь
wav-файл, длительность которого больше хотя бы 1 секунды. На
консоль программа выводит количество успешных запуском процесса
для воспроизведения звука. У меня таких запусков не больше 120.
// BEGIN
#include<sys/types.h>
#include<unistd.h>
#include<sys/wait.h>
#include<stdlib.h>
#include<stdio.h>
pid_t mp;
void play(char *name)
{
mp = fork();
if (mp == 0)
{
pid_t pp;
setpgrp();
pp = fork();
if (pp == 0)
{
execlp("play", "play", name, NULL);
}
waitpid(pp, NULL, 0);
exit(0);
}
}
void stop()
{
pid_t p;
killpg(mp, SIGKILL);
while((p = waitpid(-1*mp, NULL, WNOHANG))>0);
}
int main(int argc, char *argv[])
{
int k = 1;
play(argv[1]);
while(1)
{
printf("%u\n", k++);
sleep(1);
stop();
play(argv[1]);
}
return (0);
}
// END
--
Best wishes. Michael Pozhidaev. E-mail: msp@altlinux.ru.
Tomsk state university.
Computer science department. (http://www.inf.tsu.ru)
next prev parent reply other threads:[~2004-03-21 9:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-21 7:20 Michael Pozhidaev
2004-03-21 8:24 ` Andrey Rahmatullin
2004-03-21 9:03 ` Michael Pozhidaev [this message]
2004-03-21 9:46 ` Andrey Rahmatullin
2004-03-21 10:14 ` Michael Pozhidaev
2004-03-21 11:48 ` {Spam?} " Sergey Vlasov
2004-03-21 13:13 ` Michael Pozhidaev
2004-03-22 9:22 ` Sergey Pinaev
2004-03-22 10:58 ` Michael Pozhidaev
2004-03-22 11:13 ` Sergey Pinaev
2004-03-22 12:55 ` Michael Pozhidaev
2004-03-22 13:48 ` Sergey Pinaev
2004-03-22 14:18 ` Michael Pozhidaev
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=405D5A4E.6090906@altlinux.ru \
--to=msp@altlinux.ru \
--cc=devel@altlinux.ru \
/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
ALT Linux Team development discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
public-inbox-index devel
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.devel
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git