<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic programme/script to openfiles in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/programme-script-to-openfiles/m-p/3311025#M185592</link>
    <description>Hello&lt;BR /&gt;&lt;BR /&gt;I'm trying to open a specific number of files to try and hit my limit with the below piece of code&lt;BR /&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt; &lt;BR /&gt;#include &lt;FCNTL.H&gt; &lt;BR /&gt;#include &lt;UNISTD.H&gt; &lt;BR /&gt;#include &lt;STDLIB.H&gt; &lt;BR /&gt;&lt;BR /&gt;int     main(int argc, char *argv[]) &lt;BR /&gt;{ &lt;BR /&gt;        if ( argc != 2 ) { &lt;BR /&gt;                printf("Usage : %s &lt;NOFILES&gt;\n", argv[0]); &lt;BR /&gt;                exit(1); &lt;BR /&gt;        } &lt;BR /&gt;&lt;BR /&gt;        printf("\nOur pid is %d\n\n", getpid()); &lt;BR /&gt;&lt;BR /&gt;        int     i, fd; &lt;BR /&gt;        int     j = atoi(argv[1]); &lt;BR /&gt;&lt;BR /&gt;        for (i = 0; i &amp;lt;= j; i++) { &lt;BR /&gt;                if ( fd = ( open("/var/tmp/james/open_file", O_RDONLY | O_CREAT, 0600)) &amp;lt; 0 ) { &lt;BR /&gt;                        perror("open"); &lt;BR /&gt;                        exit(2); &lt;BR /&gt;                } &lt;BR /&gt;        } &lt;BR /&gt;&lt;BR /&gt;        printf("Finished %d opens for process %d......\n", i - 1, getpid()); &lt;BR /&gt;&lt;BR /&gt;        sleep(100); &lt;BR /&gt;        exit(0); &lt;BR /&gt;&lt;BR /&gt;} &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;My c knowledge is 0, when I try to compile with&lt;BR /&gt;&lt;BR /&gt;cc openf.c&lt;BR /&gt;&lt;BR /&gt;I get the below&lt;BR /&gt;&lt;BR /&gt;(Bundled) cc: "openf.c", line 18: error 1000: Unexpected symbol: "int".&lt;BR /&gt;(Bundled) cc: "openf.c", line 6: error 1705: Function prototypes are an ANSI feature.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Can anyone help or have a perl/c/shell programme to do a similar thing&lt;BR /&gt;&lt;BR /&gt;I'm going home for the day but would be grateful if supplied for the morning&lt;BR /&gt;&lt;BR /&gt;thanks in advance&lt;BR /&gt;&lt;BR /&gt;Steve&lt;/NOFILES&gt;&lt;/STDLIB.H&gt;&lt;/UNISTD.H&gt;&lt;/FCNTL.H&gt;&lt;/STDIO.H&gt;</description>
    <pubDate>Mon, 21 Jun 2004 12:38:26 GMT</pubDate>
    <dc:creator>steven Burgess_2</dc:creator>
    <dc:date>2004-06-21T12:38:26Z</dc:date>
    <item>
      <title>programme/script to openfiles</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/programme-script-to-openfiles/m-p/3311025#M185592</link>
      <description>Hello&lt;BR /&gt;&lt;BR /&gt;I'm trying to open a specific number of files to try and hit my limit with the below piece of code&lt;BR /&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt; &lt;BR /&gt;#include &lt;FCNTL.H&gt; &lt;BR /&gt;#include &lt;UNISTD.H&gt; &lt;BR /&gt;#include &lt;STDLIB.H&gt; &lt;BR /&gt;&lt;BR /&gt;int     main(int argc, char *argv[]) &lt;BR /&gt;{ &lt;BR /&gt;        if ( argc != 2 ) { &lt;BR /&gt;                printf("Usage : %s &lt;NOFILES&gt;\n", argv[0]); &lt;BR /&gt;                exit(1); &lt;BR /&gt;        } &lt;BR /&gt;&lt;BR /&gt;        printf("\nOur pid is %d\n\n", getpid()); &lt;BR /&gt;&lt;BR /&gt;        int     i, fd; &lt;BR /&gt;        int     j = atoi(argv[1]); &lt;BR /&gt;&lt;BR /&gt;        for (i = 0; i &amp;lt;= j; i++) { &lt;BR /&gt;                if ( fd = ( open("/var/tmp/james/open_file", O_RDONLY | O_CREAT, 0600)) &amp;lt; 0 ) { &lt;BR /&gt;                        perror("open"); &lt;BR /&gt;                        exit(2); &lt;BR /&gt;                } &lt;BR /&gt;        } &lt;BR /&gt;&lt;BR /&gt;        printf("Finished %d opens for process %d......\n", i - 1, getpid()); &lt;BR /&gt;&lt;BR /&gt;        sleep(100); &lt;BR /&gt;        exit(0); &lt;BR /&gt;&lt;BR /&gt;} &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;My c knowledge is 0, when I try to compile with&lt;BR /&gt;&lt;BR /&gt;cc openf.c&lt;BR /&gt;&lt;BR /&gt;I get the below&lt;BR /&gt;&lt;BR /&gt;(Bundled) cc: "openf.c", line 18: error 1000: Unexpected symbol: "int".&lt;BR /&gt;(Bundled) cc: "openf.c", line 6: error 1705: Function prototypes are an ANSI feature.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Can anyone help or have a perl/c/shell programme to do a similar thing&lt;BR /&gt;&lt;BR /&gt;I'm going home for the day but would be grateful if supplied for the morning&lt;BR /&gt;&lt;BR /&gt;thanks in advance&lt;BR /&gt;&lt;BR /&gt;Steve&lt;/NOFILES&gt;&lt;/STDLIB.H&gt;&lt;/UNISTD.H&gt;&lt;/FCNTL.H&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Mon, 21 Jun 2004 12:38:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/programme-script-to-openfiles/m-p/3311025#M185592</guid>
      <dc:creator>steven Burgess_2</dc:creator>
      <dc:date>2004-06-21T12:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: programme/script to openfiles</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/programme-script-to-openfiles/m-p/3311026#M185593</link>
      <description>Your problem is that the Bundled C compiler only speaks K&amp;amp;R and knows nothing about ANSI C syntax.&lt;BR /&gt;&lt;BR /&gt;Your functions, including main() must use K &amp;amp; R C, e.g:&lt;BR /&gt;&lt;BR /&gt;int main(int argc, char *argv[]) &lt;BR /&gt;must be instead:&lt;BR /&gt;int main(argc,argv)&lt;BR /&gt;int argc;&lt;BR /&gt;char *argv[];&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;}</description>
      <pubDate>Mon, 21 Jun 2004 12:43:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/programme-script-to-openfiles/m-p/3311026#M185593</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-06-21T12:43:43Z</dc:date>
    </item>
  </channel>
</rss>

