<?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 Hi, Tina. in Intel® Software Guard Extensions (Intel® SGX)</title>
    <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/File-Handling-within-Enclave/m-p/1128771#M1849</link>
    <description>&lt;P&gt;Hi, Tina.&lt;/P&gt;

&lt;P&gt;From the &lt;A href="https://download.01.org/intel-sgx/linux-1.9/docs/Intel_SGX_SDK_Developer_Reference_Linux_1.9_Open_Source.pdf"&gt;Developer Reference&lt;/A&gt;, on page 106-107:&lt;/P&gt;

&lt;P&gt;To use the Intel SGX Protected File System libraries:&lt;BR /&gt;
	&lt;SPAN style="font-size: 1em;"&gt;1. The enclave must be linked with libsgx_tprotected_fs.a&lt;/SPAN&gt;&lt;BR /&gt;
	&lt;SPAN style="font-size: 1em;"&gt;2. The application must be linked with libsgx_uprotected_fs.a&lt;BR /&gt;
	3. The enclave’s EDL file must ‘import’ all the functions from sgx_tprotected_fs.edl&lt;BR /&gt;
	4. The source files should ‘include’ sgx_tprotected_fs.h&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Rodolfo&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jan 2018 17:12:26 GMT</pubDate>
    <dc:creator>Rodolfo_S_</dc:creator>
    <dc:date>2018-01-24T17:12:26Z</dc:date>
    <item>
      <title>File Handling within Enclave</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/File-Handling-within-Enclave/m-p/1128770#M1848</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I have the latest linux SGX SDK. I am trying to do "protected" file handling using the sgx_fread, sgx_fopen etc.&lt;/P&gt;

&lt;P&gt;My Enclave code compiles well when the header&amp;nbsp;&amp;nbsp;&lt;SPAN style="color: rgb(102, 102, 102); font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 13px; background-color: rgb(242, 242, 242);"&gt;sgx_tprotected_fs.h is included.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;However the linking stage return "undefined reference to sgx_fread" etc.&lt;/P&gt;

&lt;P&gt;What library should be linked ?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Tina&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 16:36:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/File-Handling-within-Enclave/m-p/1128770#M1848</guid>
      <dc:creator>bergmann__Tina</dc:creator>
      <dc:date>2018-01-24T16:36:10Z</dc:date>
    </item>
    <item>
      <title>Hi, Tina.</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/File-Handling-within-Enclave/m-p/1128771#M1849</link>
      <description>&lt;P&gt;Hi, Tina.&lt;/P&gt;

&lt;P&gt;From the &lt;A href="https://download.01.org/intel-sgx/linux-1.9/docs/Intel_SGX_SDK_Developer_Reference_Linux_1.9_Open_Source.pdf"&gt;Developer Reference&lt;/A&gt;, on page 106-107:&lt;/P&gt;

&lt;P&gt;To use the Intel SGX Protected File System libraries:&lt;BR /&gt;
	&lt;SPAN style="font-size: 1em;"&gt;1. The enclave must be linked with libsgx_tprotected_fs.a&lt;/SPAN&gt;&lt;BR /&gt;
	&lt;SPAN style="font-size: 1em;"&gt;2. The application must be linked with libsgx_uprotected_fs.a&lt;BR /&gt;
	3. The enclave’s EDL file must ‘import’ all the functions from sgx_tprotected_fs.edl&lt;BR /&gt;
	4. The source files should ‘include’ sgx_tprotected_fs.h&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Rodolfo&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 17:12:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/File-Handling-within-Enclave/m-p/1128771#M1849</guid>
      <dc:creator>Rodolfo_S_</dc:creator>
      <dc:date>2018-01-24T17:12:26Z</dc:date>
    </item>
    <item>
      <title>Hi ,</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/File-Handling-within-Enclave/m-p/1128772#M1850</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks. I linked the required libraries as follows. Somehow one lib seems to depend on the other and finally most of the link errors got resolved by having the following libraries linked:&lt;/P&gt;

&lt;DIV&gt;Enclave_Link_Flags += -lsgx_tprotected_fs -lsgx_tservice -lsgx_tcrypto -lsgx_tstdc&lt;/DIV&gt;

&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;

&lt;DIV&gt;However I am unable to resolve to resolve this particular error&lt;/DIV&gt;

&lt;DIV&gt;
	&lt;PRE class="brush:plain;"&gt;sgxsdk/lib64/libsgx_tprotected_fs.a(lru_cache.o): In function `std::__1::__hash_table&amp;lt;std::__1::__hash_value_type&amp;lt;unsigned long, _map_node*&amp;gt;, std::__1::__unordered_map_hasher&amp;lt;unsigned long, std::__1::__hash_value_type&amp;lt;unsigned long, _map_node*&amp;gt;, std::__1::hash&amp;lt;unsigned long&amp;gt;, true&amp;gt;, std::__1::__unordered_map_equal&amp;lt;unsigned long, std::__1::__hash_value_type&amp;lt;unsigned long, _map_node*&amp;gt;, std::__1::equal_to&amp;lt;unsigned long&amp;gt;, true&amp;gt;, std::__1::allocator&amp;lt;std::__1::__hash_value_type&amp;lt;unsigned long, _map_node*&amp;gt; &amp;gt; &amp;gt;::rehash(unsigned long)':
lru_cache.cpp:(.text._ZNSt3__112__hash_tableINS_17__hash_value_typeImP9_map_nodeEENS_22__unordered_map_hasherImS4_NS_4hashImEELb1EEENS_21__unordered_map_equalImS4_NS_8equal_toImEELb1EEENS_9allocatorIS4_EEE6rehashEm[_ZNSt3__112__hash_tableINS_17__hash_value_typeImP9_map_nodeEENS_22__unordered_map_hasherImS4_NS_4hashImEELb1EEENS_21__unordered_map_equalImS4_NS_8equal_toImEELb1EEENS_9allocatorIS4_EEE6rehashEm]+0x77): undefined reference to `std::__1::__next_prime(unsigned long)'
lru_cache.cpp:(.text._ZNSt3__112__hash_tableINS_17__hash_value_typeImP9_map_nodeEENS_22__unordered_map_hasherImS4_NS_4hashImEELb1EEENS_21__unordered_map_equalImS4_NS_8equal_toImEELb1EEENS_9allocatorIS4_EEE6rehashEm[_ZNSt3__112__hash_tableINS_17__hash_value_typeImP9_map_nodeEENS_22__unordered_map_hasherImS4_NS_4hashImEELb1EEENS_21__unordered_map_equalImS4_NS_8equal_toImEELb1EEENS_9allocatorIS4_EEE6rehashEm]+0x104): undefined reference to `std::__1::__next_prime(unsigned long)'
collect2: error: ld returned 1 exit status&lt;/PRE&gt;
&lt;/DIV&gt;

&lt;DIV&gt;Infact I searched the SDK and could not find this function&amp;nbsp;&lt;SPAN style="font-weight: 700;"&gt;std::__1::__next_prime(unsigned long)&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;

&lt;DIV&gt;Please help.&lt;/DIV&gt;

&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;

&lt;DIV&gt;Thanks,&lt;/DIV&gt;

&lt;DIV&gt;Tina&lt;/DIV&gt;

&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;

&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Thu, 25 Jan 2018 08:43:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/File-Handling-within-Enclave/m-p/1128772#M1850</guid>
      <dc:creator>bergmann__Tina</dc:creator>
      <dc:date>2018-01-25T08:43:13Z</dc:date>
    </item>
    <item>
      <title>Hi bergmann: </title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/File-Handling-within-Enclave/m-p/1128773#M1851</link>
      <description>&lt;P&gt;Hi &lt;A href="https://software.intel.com/en-us/user/1696753" style="font-size: 11px; background-color: rgb(238, 238, 238);"&gt;bergmann&lt;/A&gt;:&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I have write a demo to show how to use protected fs, You can compare you makefile with mine.&lt;/P&gt;

&lt;P&gt;I think the reason is&amp;nbsp;&lt;SPAN style="color: rgb(0, 0, 0); font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; background-color: rgb(248, 248, 248);"&gt;lru_cache&lt;/SPAN&gt;&amp;nbsp;needs&amp;nbsp;&lt;SPAN style="color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, Courier, monospace; font-size: 13.6px; background-color: rgba(27, 31, 35, 0.05);"&gt;libc++-dev&lt;/SPAN&gt;&amp;nbsp;but you didn't link it.&lt;/P&gt;

&lt;P&gt;The project is here :&lt;A href="https://github.com/light1021/SGX-protected-fs-demo"&gt;https://github.com/light1021/SGX-protected-fs-demo&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;

&lt;P&gt;you&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2018 09:58:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/File-Handling-within-Enclave/m-p/1128773#M1851</guid>
      <dc:creator>you_w_</dc:creator>
      <dc:date>2018-01-25T09:58:22Z</dc:date>
    </item>
    <item>
      <title>Hi,</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/File-Handling-within-Enclave/m-p/1128774#M1852</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Thanks. The project compiles now after adding libc++-dev.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;I have one more question. The sgx_fread and sgx_fseek called in my program returns error. I then use sgx_error(fp) to return the error code. However I don't know what these error codes mean. Which header contains errors corresponding to sgx_ferror?I&amp;nbsp; get a 0x16 as error code.&lt;/P&gt;

&lt;P&gt;Thanks once again!&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2018 15:14:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/File-Handling-within-Enclave/m-p/1128774#M1852</guid>
      <dc:creator>bergmann__Tina</dc:creator>
      <dc:date>2018-01-25T15:14:23Z</dc:date>
    </item>
    <item>
      <title>Hi ：</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/File-Handling-within-Enclave/m-p/1128775#M1853</link>
      <description>&lt;P&gt;Hi ：&lt;/P&gt;

&lt;P&gt;The errors are usually defined in sgx_error.h. But I didn't find you error code. Error codes related to protected FS are look like 0x700*. So I don't know what 0x16 stands for.&lt;/P&gt;

&lt;P&gt;Kind regards&lt;/P&gt;

&lt;P&gt;you&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2018 01:19:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/File-Handling-within-Enclave/m-p/1128775#M1853</guid>
      <dc:creator>you_w_</dc:creator>
      <dc:date>2018-01-26T01:19:49Z</dc:date>
    </item>
  </channel>
</rss>

