Stay organized with collections
Save and categorize content based on your preferences.
StructPollfd
class StructPollfd
Used as an in/out parameter to Os.poll
. Corresponds to C's struct pollfd
from <poll.h>
.
Summary
Properties |
Short |
The events we're interested in.
|
FileDescriptor! |
The file descriptor to poll.
|
Short |
The events that actually happened.
|
Any! |
A non-standard extension that lets callers conveniently map back to the object their fd belongs to.
|
Public constructors
StructPollfd
StructPollfd()
Public methods
toString
fun toString(): String
Return |
String |
a string representation of the object. |
Properties
events
var events: Short
The events we're interested in. POLLIN corresponds to being in select(2)'s read fd set, POLLOUT to the write fd set.
revents
var revents: Short
The events that actually happened.
userData
var userData: Any!
A non-standard extension that lets callers conveniently map back to the object their fd belongs to. This is used by Selector, for example, to associate each FileDescriptor with the corresponding SelectionKey.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# StructPollfd\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nStructPollfd\n============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/system/StructPollfd \"View this page in Java\") \n\n```\nclass StructPollfd\n```\n\n|---|----------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.system.StructPollfd](#) |\n\nUsed as an in/out parameter to [Os.poll](/reference/kotlin/android/system/Os#poll(kotlin.Array,%20kotlin.Int)). Corresponds to C's `struct pollfd` from `\u003cpoll.h\u003e`.\n\nSummary\n-------\n\n| Public constructors ||\n|--------------------------------------------|---|\n| [StructPollfd](#StructPollfd())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|----------------------------------------------------------------------------------|------------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [toString](#toString())`()` \u003cbr /\u003e |\n\n| Properties ||\n|--------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|\n| [Short](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-short/index.html) | [events](#events:kotlin.Short) The events we're interested in. |\n| [FileDescriptor](../../java/io/FileDescriptor.html#)! | [fd](#fd:java.io.FileDescriptor) The file descriptor to poll. |\n| [Short](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-short/index.html) | [revents](#revents:kotlin.Short) The events that actually happened. |\n| [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)! | [userData](#userData:kotlin.Any) A non-standard extension that lets callers conveniently map back to the object their fd belongs to. |\n\nPublic constructors\n-------------------\n\n### StructPollfd\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nStructPollfd()\n```\n\nPublic methods\n--------------\n\n### toString\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun toString(): String\n```\n\n| Return ||\n|----------------------------------------------------------------------------------|----------------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | a string representation of the object. |\n\nProperties\n----------\n\n### events\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nvar events: Short\n```\n\nThe events we're interested in. POLLIN corresponds to being in select(2)'s read fd set, POLLOUT to the write fd set. \n\n### fd\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nvar fd: FileDescriptor!\n```\n\nThe file descriptor to poll. \n\n### revents\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nvar revents: Short\n```\n\nThe events that actually happened. \n\n### userData\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nvar userData: Any!\n```\n\nA non-standard extension that lets callers conveniently map back to the object their fd belongs to. This is used by Selector, for example, to associate each FileDescriptor with the corresponding SelectionKey."]]