PDA

View Full Version : Function confusion



KShots
25th June 2007, 20:37
Hello all,

I've got a newbie'ish question here, that's not really Qt-specific (I'd likely encounter this problem elsewhere as well).

I'm trying to call an ioctl from within a QWidget framework. As such, I need access to the open() function (no problem), the ioctl function (no problem)... and the close(int) function (uh oh... QObject has a close() function! )

So... close() is defined under unistd.h, and does not lie under a namespace or anything else I may use to uniquely identify it.

Any chance there's a way for me to call this bugger from within my QObject framework? Attempting to call it makes gcc think that I'm trying to call the QWidget::close() function.

jpn
25th June 2007, 20:53
Any chance there's a way for me to call this bugger from within my QObject framework? Attempting to call it makes gcc think that I'm trying to call the QWidget::close() function.
Try with global namespace:

::close(fd);

marcel
25th June 2007, 20:54
try using the resolution operator:
::close().

EDIT: damn, I was only a minute away :)

Regards

KShots
26th June 2007, 21:56
Try with global namespace:

::close(fd);


try using the resolution operator:
::close().

EDIT: damn, I was only a minute away :)

Regards

Thanks, that worked great.