ldv changed the topic of #strace to: https://strace.io | https://strace.io/logs/ | strace 4.23 is out | strace-devel@lists.strace.io for dev discussions
pombreda has joined #strace
haoyouab has joined #strace
<haoyouab> Hi guys, it's Zhibin Li here.
<haoyouab> I'm on my way home and there was something wrong with my VPN so I lost all connections to IRC and email.
<haoyouab> I just saw the patch "document check_quota
<haoyouab> from eSyr and I don't understand what this opaque pointer is used for.
<haoyouab> Is opaque pointer used for hiding details or encapsulation? Then what addr_cb_arg is doing exactly?
mjw has joined #strace
<haoyouab> if (((rc != 0) && out_arg) || (out_arg > 1))
<haoyouab> What does the "out_arg" check?
<haoyouab> I may not stay online, but I will check the log later :)
haoyouab has left #strace [#strace]
<esyrd> haoyouab: it may be used by a callback.
haoyouab has joined #strace
<esyrd> (and it is in case of print_xdisk_quota/print_xquota_stat/print_xquota_statv)
<haoyouab> esyrd: yes I noticed that. But what if there are only two params in these callbakc functions?
<haoyouab> s/callbakc/callback
<esyrd> there should be three, it's UB otherwise.
<esyrd> (it most likely would work on most platforms, however)
<haoyouab> Oh, sorry, I didn't know this before
<haoyouab> So it's some kind of standard right?
<haoyouab> Or something like that
<esyrd> well, passing opaque argument longwith callback pointer is pretty common, yeah.
<esyrd> it's widely used in netlink parsing code, for example.
<haoyouab> Ok I see it now
<esyrd> or some other places where callback behaviour can vary wildly.
<haoyouab> (Seems I still have a long way to go...)
<haoyouab> wait, so this opaque argument is probably not used?
<haoyouab> it seems that out_arg in those callback funtions is used along with if(rc != 0) to decide whether print those structures of not.
haoyouab has quit [Quit: leaving]
<esyrd> Yes, in case of those callbacks it is the way to avoid dereferencing invalid pointer that is passed in some syscall invocations.
mjw has quit [Quit: Leaving]
pombreda has quit [Ping timeout: 244 seconds]
pombreda has joined #strace