cURL / Mailing Lists / curl-library / Single Mail


libcurl on QNX 6

From: <>
Date: Thu, 20 Dec 2001 10:36:17 -0000


We're investigating libcurl 7.9.2 to implement basic FTP transfers between
an embedded application running QNX 6/Neutrino 2.11 operating system and a
Windows NT maintenance PC (running Microsoft's FTP Server). So far I've only
considered FTP GET, but every time it runs, it crashes with SIGSEGV in the
curl_easy_perform(..) function.

I have successfully built/run the equivalent under an NT simulation

The code excerpt follows. srcFile and dstFile are char strings of the file's
remote source and local destination. destination is a char string of the
internet address of the NT PC (numeric dot format). As far as I can see, its
a very simple thing to do. debugPrintf is a simple debug print function for
our embeddded environment, i.e ignore it...

ftp_get_function (char *srcFile, char *dstFile, char *destination)
   FILE *ftp;
   char url[128], *c;
   int i;
   CURL *curl;
   CURLcode res;
   // open the local (destination) file
   ftp = fopen(dstFile,"wb");

   debugPrintf(1,"CURL->easy init...");
   curl = curl_easy_init();
      sprintf(url,"ftp://%s%s", destination, srcFile);
      debugPrintf(1,"OK\nCURL->url = %s\n",url);
      curl_easy_setopt(curl, CURLOPT_URL, url);
      curl_easy_setopt(curl, CURLOPT_FILE, ftp);
      curl_easy_setopt(curl, CURLOPT_NETRC, 1);

      res = curl_easy_perform(curl);



An example call to this would be

   ftp_get_function("/pmu/database.db", "/database/localdb.db",

Regarding the build process under QNX 6, I've built it as a static library.
Also, I had to disable the configuration checks for gethostbyname() in
socket and nsl libraries. Other than that, libcurl built with no worries,
and linked quite happily into our application.

Any ideas?


Dave Bentham
Senior Software Engineer

Siemens Transportation Systems Limited

Tel. +44 1202 84 6103
Fax. +44 1202 78 2893

Visit us at

This communication contains information which is confidential, and is for
the exclusive use of the addressee(s). If you are not a named addressee
please contact the sender immediately, and also delete the communication
from your system.

Any views or opinions presented are solely those of the author and do not
necessarily represent those of Siemens plc unless otherwise specifically
Received on 2001-12-20