import from http://www.ibm.com/developerworks/jp/opensource/library/os-curl/#N100C4