Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52265 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18241 invoked from network); 11 May 2011 03:43:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 May 2011 03:43:20 -0000 Authentication-Results: pb1.pair.com smtp.mail=sosagabriel@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=sosagabriel@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: sosagabriel@gmail.com X-Host-Fingerprint: 209.85.220.170 mail-vx0-f170.google.com Received: from [209.85.220.170] ([209.85.220.170:40164] helo=mail-vx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 99/B8-04851-8D50ACD4 for ; Tue, 10 May 2011 23:43:20 -0400 Received: by vxb40 with SMTP id 40so81979vxb.29 for ; Tue, 10 May 2011 20:43:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:from:date:message-id:subject:to :content-type; bh=9E7FC373UsalCwghXF5A5W9iel4zvFAniUfdKrV1DPE=; b=qlxMmqn6VUgEShyROr2BhwasnvaJY0t+RjuuSXC5Ti3VHxASmbEN5+BJhcvHRNWR39 9/1nrZe295YIeKbKLAxRCvlZwW8JUPsdeYzOoEJiCkMHJkE3BMH+96Ybmw+03toJ51Ov Gf+0yNxRKtgtxrZ1YhFD3Futwc6Lhjf/mdFQE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=CYvNSAkRvi0BD3iryAxvSP7SYpYYJfhe3lknSJ99VwKY39oQBaWVfHXZChpEmfPKrZ HvByqaWbV6X/86aZs54y3gk6mifWSH85HnfOq/CxYvX+5iRq7sHPRywnCA35hmcFpGXS BUtXuu+xMxd4eUMiAJn+xaaEk3WSJwdqkoOes= Received: by 10.220.45.134 with SMTP id e6mr2169715vcf.55.1305085398174; Tue, 10 May 2011 20:43:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.199.8 with HTTP; Tue, 10 May 2011 20:42:58 -0700 (PDT) Date: Wed, 11 May 2011 00:42:58 -0300 Message-ID: To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: making system calls from a php extension From: sosagabriel@gmail.com (Gabriel Sosa) hello everyone! I'm trying to gain some speed by moving a function from PHP legacy code to C and making an extension. I'm trying to call *lynx* from the command line since their C api isn't something soo nice likely to use it as any other libXX Currently in PHP I'm doing a system call by using *proc_open* and sending and getting the response. Moving the code to C code I found that I need a "bidirectional" popen to replicate the PHP behavior, and since this is not allowed/implemented by default on POSIX environments I'm forced to fork to get this working. So back to my question: How feasible is to make fork calls on a PHP extension? Can I just do it or should I use php_stream_* functions to get a stream and make the system call? To avoid some questions the main idea of this extension is to be used on POSIX environments, so basically I dont care if this is not compatible with Windows. Thanks for your time. -- Gabriel Sosa Si buscas resultados distintos, no hagas siempre lo mismo. - Einstein