ethtool_cpy(9)
π ethtool_cpy(9) β the Kernel API Manual, bestie edition π
okay so this is ethtool_cpy(9) from the Kernel API Manual, and before you ask β yes, it's a whole little function for putting strings into ethtool string data, and yes, the "possibly-not-NUL-terminated" of it all is the main character here. Let's get into it β¨
πΈ NAME πΈ
ethtool_cpy β write a string that might not be NUL-terminated into ethtool string data π«Ά
like, that's literally the whole job. no cap.
β¨ SYNOPSIS β¨
ethtool_cpy (data , str );
that's it, that's the vibe check π
π¦ ARGUMENTS π¦
dataβ a pointer to a pointer to the start of the string you're writing into. yes, double pointer. two layers. it's giving inception, but make it C πstrβ a NUL-byte paddedchararray of sizeETH_GSTRING_LENthat you're copying from. note the padding, bestie β it'sNUL-byte padded, not necessarilyNUL-terminated, and that distinction is the whole plot π
π SEE ALSO π
like a true icon, ethtool_cpy rolls deep. the whole clique lives in the kernel file ./include/linux/ethtool.h β here's everybody in the group chat π
enum ethtool_phys_id_state(9)struct kernel_ethtool_ringparam(9)enum ethtool_supported_ring_param(9)ethtool_rxfh_indir_default(9)struct ethtool_rxfh_context(9)ethtool_link_ksettings_zero_link_mode(9)ethtool_link_ksettings_add_link_mode(9)ethtool_link_ksettings_del_link_mode(9)ethtool_link_ksettings_test_link_mode(9)ethtool_intersect_link_masks(9)struct ethtool_phy_stats(9)struct ethtool_pause_stats(9)struct ethtool_fec_hist_range(9)struct ethtool_fec_stats(9)struct ethtool_rmon_hist_range(9)struct ethtool_rmon_stats(9)struct ethtool_ts_stats(9)struct ethtool_module_eeprom(9)struct ethtool_module_power_mode_params(9)struct ethtool_mm_state(9)struct ethtool_mm_cfg(9)struct ethtool_mm_stats(9)struct ethtool_mmsv_ops(9)struct ethtool_mmsv(9)struct ethtool_rxfh_param(9)struct ethtool_rxfh_fields(9)struct kernel_ethtool_ts_info(9)struct ethtool_ops(9)struct ethtool_netdev_state(9)struct ethtool_phy_ops(9)ethtool_set_ethtool_phy_ops(9)ethtool_params_from_link_mode(9)ethtool_get_phc_vclocks(9)ethtool_mm_frag_size_add_to_min(9)ethtool_mm_frag_size_min_to_add(9)ethtool_get_ts_info_by_layer(9)ethtool_sprintf(9)ethtool_puts(9)
like I said β entire friend group. and honestly ethtool_sprintf(9) and ethtool_puts(9) are right there at the end being the sibling energy of it all π
ok real talk though bestie:stris only padded toETH_GSTRING_LEN, so don't be out here assuming it's NUL-terminated. that's the whole reason this function exists instead of you just vibing withstrcpy. respect the padding π
and that's the page!! π§ it lives in ./include/linux, dated October 2026, in the Kernel API Manual β mwah, sending you a big kiss, go forth and copy your strings correctly ππΈβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms