Re: [PATCH RESEND v3 1/2] selftests/resctrl: Fix schemata write error check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Maciej,

On 9/11/2023 11:32 PM, Maciej Wieczór-Retman wrote:
> On 2023-09-11 at 09:59:06 -0700, Reinette Chatre wrote:
>> Hi Maciej,
>> When I build the tests with this applied I encounter the following:
>>
>> resctrlfs.c: In function ‘write_schemata’:
>> resctrlfs.c:475:14: warning: implicit declaration of function ‘open’; did you mean ‘popen’? [-Wimplicit-function-declaration]
>>  475 |         fd = open(controlgroup, O_WRONLY);
>>      |              ^~~~
>>      |              popen
>> resctrlfs.c:475:33: error: ‘O_WRONLY’ undeclared (first use in this function)
>>  475 |         fd = open(controlgroup, O_WRONLY);
>>      |                                 ^~~~~~~~
>> resctrlfs.c:475:33: note: each undeclared identifier is reported only once for each function it appears in
> 
> Hmm, that's odd. How do you build the tests?

I applied this series on top of kselftest repo's "next" branch.

I use a separate build directory and first ran "make headers". After that,
$ make O=<build dir> -C tools/testing/selftests/resctrl

> I use "make -C tools/testing/selftests/resctrl" while in the root kernel
> source directory. I tried to get the same error you experienced by
> compiling some dummy test program with "open" and "O_WRONLY". From the
> experiment I found that the "resctrl.h" header provides the declarations
> that are causing your errors.

>From what I can tell resctrl.h does not include fcntl.h that provides
what is needed.

Reinette



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux